From cc6bf9a06f0629f16ab455ad30b6c7b1a76ac0c2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 24 Jun 2001 01:41:38 +0000 Subject: fixed error using wrong pointer to test and free s/str/s/ (This used to be commit 7e5a9860fad92fee79bcc20f2ea2a3728080dba2) --- source3/param/loadparm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 72856ddafe..4ba219adbf 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -3683,12 +3683,11 @@ char **lp_list_make(char *string) if (!string || !*string) return NULL; s = strdup(string); - if (!str || !*str) return NULL; - str = s; + if (!s || !*s) return NULL; list = (char**)malloc(((sizeof(char**)) * P_LIST_ABS)); if (!list) { - free (str); + free (s); return NULL; } memset (list, 0, ((sizeof(char**)) * P_LIST_ABS)); @@ -3696,6 +3695,7 @@ char **lp_list_make(char *string) num = 0; + str = s; while (*str) { if (!next_token(&str, tok, LIST_SEP, sizeof(pstring))) continue; @@ -3705,7 +3705,7 @@ char **lp_list_make(char *string) rlist = (char **)realloc(list, ((sizeof(char **)) * lsize)); if (!rlist) { lp_list_free (list); - free (str); + free (s); return NULL; } else list = rlist; @@ -3715,7 +3715,7 @@ char **lp_list_make(char *string) list[num] = strdup(tok); if (!list[num]) { lp_list_free (list); - free (str); + free (s); return NULL; } -- cgit