Revert "Fix bug 5698 - mixup of TALLOC/malloc. Spotted by Douglas Wegscheid <Douglas_...
authorKarolin Seeger <kseeger@samba.org>
Wed, 27 Aug 2008 08:36:58 +0000 (10:36 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 27 Aug 2008 08:36:58 +0000 (10:36 +0200)
This reverts commit 3c205320cd1eb19ed275572f975487e92c611f13.

source/lib/util_str.c

index a2458c88b60aaab74e5cd44177715ea1b3da5218..c36d512239cdb9dd61ea143b6cb21b9f5cd181ef 100644 (file)
@@ -2006,7 +2006,6 @@ bool str_list_sub_basic( char **list, const char *smb_name,
 
 bool str_list_substitute(char **list, const char *pattern, const char *insert)
 {
-       TALLOC_CTX *ctx = list;
        char *p, *s, *t;
        ssize_t ls, lp, li, ld, i, d;
 
@@ -2029,7 +2028,7 @@ bool str_list_substitute(char **list, const char *pattern, const char *insert)
                        t = *list;
                        d = p -t;
                        if (ld) {
-                               t = TALLOC_ARRAY(ctx, char, ls +ld +1);
+                               t = (char *) SMB_MALLOC(ls +ld +1);
                                if (!t) {
                                        DEBUG(0,("str_list_substitute: "
                                                "Unable to allocate memory"));
@@ -2037,7 +2036,7 @@ bool str_list_substitute(char **list, const char *pattern, const char *insert)
                                }
                                memcpy(t, *list, d);
                                memcpy(t +d +li, p +lp, ls -d -lp +1);
-                               TALLOC_FREE(*list);
+                               SAFE_FREE(*list);
                                *list = t;
                                ls += ld;
                                s = t +d +li;