]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: libads: Fix return from malloc check.
authorJeremy Allison <jra@samba.org>
Wed, 29 Jun 2022 15:29:28 +0000 (08:29 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 30 Jun 2022 16:28:30 +0000 (16:28 +0000)
We shouldn't be checking *realm != '\0' here, just
the return from malloc.

Coverity CID: 1506719.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 30 16:28:30 UTC 2022 on sn-devel-184

source3/libads/ads_struct.c

index 164e0a301756a77c288f39502d6f30629ef0715d..90634effc58a92c4d1870c6f1a5893197fb5306c 100644 (file)
@@ -39,8 +39,7 @@ ADS_STATUS ads_build_path(const char *realm,
        *_path = NULL;
 
        r = SMB_STRDUP(realm);
-
-       if (!r || !*r) {
+       if (r == NULL) {
                return ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
        }