diff --git a/source/lib/util.c b/source/lib/util.c index 949522cf7b3..13f5b177817 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -1594,10 +1594,13 @@ void set_namearray(name_compare_entry **ppname_array, char *namelist) void free_namearray(name_compare_entry *name_array) { + int i; + if(name_array == NULL) return; - SAFE_FREE(name_array->name); + for(i=0; name_array[i].name!=NULL; i++) + SAFE_FREE(name_array[i].name); SAFE_FREE(name_array); }