core: pvapi - added free_pvname_list()
authorDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 21 Jul 2017 06:44:37 +0000 (08:44 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 21 Jul 2017 06:44:37 +0000 (08:44 +0200)
src/core/pvapi.c
src/core/pvar.h

index 93f07a5..2f85783 100644 (file)
@@ -1470,6 +1470,19 @@ error:
        return NULL;
 }
 
+/**
+ *
+ */
+void free_pvname_list(pvname_list_t* head)
+{
+       pvname_list_t* al;
+
+       while(head) {
+               al = head;
+               head=head->next;
+               pkg_free(al);
+       }
+}
 
 
 /** destroy the content of pv_spec_t structure.
index b82198d..62ab782 100644 (file)
@@ -201,6 +201,7 @@ typedef struct pv_spec_list {
 } pv_spec_list_t, *pv_spec_list_p;
 
 pvname_list_t* parse_pvname_list(str *in, unsigned int type);
+void free_pvname_list(pvname_list_t* head);
 
 int register_pvars_mod(char *mod_name, pv_export_t *items);
 int pv_free_extra_list(void);