Correctly check for errors in strlower_m() returns.
[kai/samba.git] / source3 / lib / util.c
index 9c380c5a02d9442d120e5444141b272e0d6a9b88..b8513f6b9fa45b09e9992aceb6b16b48142967c5 100644 (file)
@@ -1892,8 +1892,14 @@ bool unix_wild_match(const char *pattern, const char *string)
                TALLOC_FREE(ctx);
                return false;
        }
-       strlower_m(p2);
-       strlower_m(s2);
+       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++) {