From: Günther Deschner Date: Tue, 12 Aug 2025 12:37:06 +0000 (+0200) Subject: s3-utils: Fix CID #1517309 Resource leak in net offlinejoin code. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf4bf9f144e1b16dbf36ccbbbf91395ad7b9706f;p=thirdparty%2Fsamba.git s3-utils: Fix CID #1517309 Resource leak in net offlinejoin code. Guenther Signed-off-by: Guenther Deschner Reviewed-by: Andreas Schneider Autobuild-User(master): Günther Deschner Autobuild-Date(master): Wed Aug 13 01:51:11 UTC 2025 on atb-devel-224 --- diff --git a/source3/utils/net_offlinejoin.c b/source3/utils/net_offlinejoin.c index e7ea518659c..135625ec800 100644 --- a/source3/utils/net_offlinejoin.c +++ b/source3/utils/net_offlinejoin.c @@ -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; }