]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-utils: Fix CID #1517309 Resource leak in net offlinejoin code.
authorGünther Deschner <gd@samba.org>
Tue, 12 Aug 2025 12:37:06 +0000 (14:37 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 13 Aug 2025 01:51:11 +0000 (01:51 +0000)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Aug 13 01:51:11 UTC 2025 on atb-devel-224

source3/utils/net_offlinejoin.c

index e7ea518659cfeeb94756f933d25e2072bac8caf2..135625ec800e39523c2210a7c4ef1413168b22ad 100644 (file)
@@ -320,6 +320,7 @@ int net_offlinejoin_requestodj(struct net_context *c,
        if (provision_bin_data_size > UINT32_MAX) {
                d_printf("provision binary data size too big: %zu\n",
                         provision_bin_data_size);
+               TALLOC_FREE(provision_bin_data);
                return -1;
        }
 
@@ -331,11 +332,14 @@ int net_offlinejoin_requestodj(struct net_context *c,
                /* NERR_JoinPerformedMustRestart */
                printf("Failed to call NetRequestOfflineDomainJoin: %s\n",
                        libnetapi_get_error_string(c->netapi_ctx, status));
+               TALLOC_FREE(provision_bin_data);
                return -1;
        }
 
        d_printf("Successfully requested Offline Domain Join\n");
 
+       TALLOC_FREE(provision_bin_data);
+
        return 0;
 }