s3: libads: Fix coverity false positive.
authorJeremy Allison <jra@samba.org>
Fri, 1 Jul 2022 15:49:42 +0000 (08:49 -0700)
committerNoel Power <npower@samba.org>
Mon, 4 Jul 2022 16:42:28 +0000 (16:42 +0000)
dn is always returned as NULL on error in ads_build_path(),
but coverity can't see that. Easy change to quieten it.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Jul  4 16:42:28 UTC 2022 on sn-devel-184

source3/libads/ads_struct.c

index 90634effc58a92c4d1870c6f1a5893197fb5306c..97f84d124d07f06a0453fd81b55c27aec5f82f70 100644 (file)
@@ -106,6 +106,7 @@ ADS_STATUS ads_build_dn(const char *realm, TALLOC_CTX *mem_ctx, char **_dn)
 
        status = ads_build_path(realm, ".", "dc=", 0, &dn);
        if (!ADS_ERR_OK(status)) {
+               SAFE_FREE(dn);
                return status;
        }