s3: lib: Move from talloc_strdup then lower to strlower_talloc()
authorJeremy Allison <jra@samba.org>
Fri, 11 Nov 2016 18:24:40 +0000 (10:24 -0800)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 16 Nov 2016 11:41:09 +0000 (12:41 +0100)
Do things in one go.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12419

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/lib/util.c

index 7e3f455882c15f0376367875345959b44393aa82..7cb613011aa466ce13cf5a24c2ad807bead1e619 100644 (file)
@@ -1920,20 +1920,12 @@ bool unix_wild_match(const char *pattern, const char *string)
        char *p;
        bool ret = false;
 
-       p2 = talloc_strdup(ctx,pattern);
-       s2 = talloc_strdup(ctx,string);
+       p2 = strlower_talloc(ctx, pattern);
+       s2 = strlower_talloc(ctx, string);
        if (!p2 || !s2) {
                TALLOC_FREE(ctx);
                return false;
        }
-       if (!strlower_m(p2)) {
-               TALLOC_FREE(ctx);
-               return false;
-       }
-       if (!strlower_m(s2)) {
-               TALLOC_FREE(ctx);
-               return false;
-       }
 
        /* Remove any *? and ** from the pattern as they are meaningless */
        for(p = p2; *p; p++) {