s3:lib Use push_ucs2_talloc() in ms_fnmatch()
authorAndrew Bartlett <abartlet@samba.org>
Wed, 18 Mar 2009 07:05:17 +0000 (18:05 +1100)
committerGünther Deschner <gd@samba.org>
Tue, 7 Apr 2009 23:15:24 +0000 (01:15 +0200)
Signed-off-by: Günther Deschner <gd@samba.org>
source3/lib/ms_fnmatch.c

index ca534467fa7153511e59aca41a72ee3479b63ac7..1eac9fa14ad99f9cc5528d61e5bc53508d767cda 100644 (file)
@@ -170,12 +170,12 @@ int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
                }
        }
 
-       if (!push_ucs2_allocate(&p, pattern, &converted_size)) {
+       if (!push_ucs2_talloc(talloc_tos(), &p, pattern, &converted_size)) {
                return -1;
        }
 
-       if (!push_ucs2_allocate(&s, string, &converted_size)) {
-               SAFE_FREE(p);
+       if (!push_ucs2_talloc(talloc_tos(), &s, string, &converted_size)) {
+               TALLOC_FREE(p);
                return -1;
        }
 
@@ -214,8 +214,8 @@ int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
                else {
                        max_n = SMB_CALLOC_ARRAY(struct max_n, count);
                        if (!max_n) {
-                               SAFE_FREE(p);
-                               SAFE_FREE(s);
+                               TALLOC_FREE(p);
+                               TALLOC_FREE(s);
                                return -1;
                        }
                        max_n_free = max_n;
@@ -225,8 +225,8 @@ int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
        ret = ms_fnmatch_core(p, s, max_n, strrchr_w(s, UCS2_CHAR('.')), is_case_sensitive);
 
        SAFE_FREE(max_n_free);
-       SAFE_FREE(p);
-       SAFE_FREE(s);
+       TALLOC_FREE(p);
+       TALLOC_FREE(s);
        return ret;
 }