From 5903657bd9bd3b4f96b3ddf4748846465b617edf Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Jun 2022 08:29:28 -0700 Subject: [PATCH] s3: libads: Fix return from malloc check. We shouldn't be checking *realm != '\0' here, just the return from malloc. Coverity CID: 1506719. Signed-off-by: Jeremy Allison Reviewed-by: Andreas Schneider Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu Jun 30 16:28:30 UTC 2022 on sn-devel-184 --- source3/libads/ads_struct.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index 164e0a30175..90634effc58 100644 --- a/source3/libads/ads_struct.c +++ b/source3/libads/ads_struct.c @@ -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); } -- 2.47.3