diff options
author | Pavel Filipenský <pfilipen@redhat.com> | 2022-01-07 14:11:53 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2022-01-10 23:31:33 +0000 |
commit | 82f53c82ed6ec4818bb1e2220e25e76fee7cb23e (patch) | |
tree | 9ba255f13a74c384e2938c1ad2f2a4eda38d7bb0 /source3/libnet | |
parent | 5ac8762256830f1c7e48dcc9684802f00fc3b5c2 (diff) | |
download | samba-82f53c82ed6ec4818bb1e2220e25e76fee7cb23e.tar.gz |
s3:libnet: Fix dead code in libnet_join.c
Found by covscan.
Pair-programmed-with: Andreas Schneider <asn@samba.org>
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/libnet')
-rw-r--r-- | source3/libnet/libnet_join.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 02705f1c70c..00d71b97f2a 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -2669,7 +2669,6 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx, ADS_STATUS ads_status; #endif /* HAVE_ADS */ const char *pre_connect_realm = NULL; - const char *numeric_dcip = NULL; const char *sitename = NULL; struct netr_DsRGetDCNameInfo *info; const char *dc; @@ -2731,7 +2730,6 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx, return WERR_NERR_DCNOTFOUND; } - numeric_dcip = info->dc_address + 2; sitename = info->dc_site_name; /* info goes out of scope but the memory stays allocated on the talloc context */ @@ -2741,8 +2739,9 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx, if (pre_connect_realm != NULL) { struct sockaddr_storage ss = {0}; + const char *numeric_dcip = info->dc_address + 2; - if (numeric_dcip != NULL) { + if (numeric_dcip[0] == '\0') { if (!interpret_string_addr(&ss, numeric_dcip, AI_NUMERICHOST)) { DBG_ERR( |