]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/libsmb: Cleanup coding in convert_ss2service()
authorNoel Power <noel.power@suse.com>
Fri, 4 Sep 2020 02:22:21 +0000 (19:22 -0700)
committerNoel Power <npower@samba.org>
Mon, 7 Sep 2020 13:23:43 +0000 (13:23 +0000)
Don't update out params when unsuccessful

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/namequery.c

index 607ad722aab47bb34fdc3313bd1f94da24771168..d6077230feca0192bd042a8f936508d49a0ae8ac 100644 (file)
@@ -1686,7 +1686,6 @@ static bool convert_ss2service(struct ip_service **return_iplist,
        struct ip_service *iplist = NULL;
 
        if (orig_count == 0 || ss_list == NULL) {
-               *count_out = 0;
                return false;
        }
 
@@ -1698,7 +1697,6 @@ static bool convert_ss2service(struct ip_service **return_iplist,
                real_count++;
        }
        if (real_count == 0) {
-               *count_out = 0;
                return false;
        }
 
@@ -1706,7 +1704,6 @@ static bool convert_ss2service(struct ip_service **return_iplist,
        iplist = SMB_MALLOC_ARRAY(struct ip_service, real_count);
        if (iplist == NULL) {
                DBG_ERR("malloc failed for %zu enetries!\n", real_count);
-               *count_out = 0;
                return false;
        }