From af6e4ea640828438fe234db1652dc4c1e10a487e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 24 Jan 2003 19:20:01 +0000 Subject: [PATCH] Fix memory leak found my Leo Qiu . Jeremy. --- source/lib/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); }