fixed error
authorSimo Sorce <idra@samba.org>
Sun, 24 Jun 2001 01:41:38 +0000 (01:41 +0000)
committerSimo Sorce <idra@samba.org>
Sun, 24 Jun 2001 01:41:38 +0000 (01:41 +0000)
using wrong pointer to test and free s/str/s/
(This used to be commit 7e5a9860fad92fee79bcc20f2ea2a3728080dba2)

source3/param/loadparm.c

index 72856ddafe3ecfad4408d7ee6b11d4fa7995da6a..4ba219adbf0f7fe7c124cf829ad540d2879117eb 100644 (file)
@@ -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;
                }