s3: lib: Change masked_match() from SMB_STRDUP macro to underlying smb_xstrdup function.
authorJeremy Allison <jra@samba.org>
Fri, 11 Nov 2016 01:02:08 +0000 (17:02 -0800)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 16 Nov 2016 11:41:09 +0000 (12:41 +0100)
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/access.c

index ad868fa7f91c20009663590f28d44fcda7c48409..49c4f8ebe09dcb1b6ba8f3496a52e2018d0d4ffd 100644 (file)
@@ -13,6 +13,7 @@
 #include "includes.h"
 #include "../lib/util/memcache.h"
 #include "lib/socket/interfaces.h"
+#include "lib/util/samba_util.h"
 
 #define NAME_INDEX 0
 #define ADDR_INDEX 1
@@ -31,14 +32,14 @@ static bool masked_match(const char *tok, const char *slash, const char *s)
 
        if (*tok == '[') {
                /* IPv6 address - remove braces. */
-               tok_copy = SMB_STRDUP(tok+1);
+               tok_copy = smb_xstrdup(tok+1);
                if (!tok_copy) {
                        return false;
                }
                /* Remove the terminating ']' */
                tok_copy[PTR_DIFF(slash,tok)-1] = '\0';
        } else {
-               tok_copy = SMB_STRDUP(tok);
+               tok_copy = smb_xstrdup(tok);
                if (!tok_copy) {
                        return false;
                }
@@ -128,7 +129,7 @@ static bool string_match(const char *tok,const char *s)
                        DEBUG(0,("Unable to get default yp domain. "
                                "Try without it.\n"));
                }
-               if (!(hostname = SMB_STRDUP(s))) {
+               if (!(hostname = smb_xstrdup(s))) {
                        DEBUG(1,("out of memory for strdup!\n"));
                        return false;
                }