The branch, master has been updated
       via  bf4bf9f144e s3-utils: Fix CID #1517309 Resource leak in net 
offlinejoin code.
       via  f5349093e75 libcli/smb: Fix CID #710784 Resource leak
      from  634dc83d5ca lib/util: Fix CID 1414760 - Memory leak

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit bf4bf9f144e1b16dbf36ccbbbf91395ad7b9706f
Author: Günther Deschner <g...@samba.org>
Date:   Tue Aug 12 14:37:06 2025 +0200

    s3-utils: Fix CID #1517309 Resource leak in net offlinejoin code.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    
    Autobuild-User(master): Günther Deschner <g...@samba.org>
    Autobuild-Date(master): Wed Aug 13 01:51:11 UTC 2025 on atb-devel-224

commit f5349093e756a191010772bdfa157a7be622a4cc
Author: Günther Deschner <g...@samba.org>
Date:   Mon Aug 11 16:58:51 2025 +0200

    libcli/smb: Fix CID #710784 Resource leak
    
    buf was (re-)allocated on NULL context thus not part of frame that is
    freed.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <g...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 libcli/smb/util.c               | 1 +
 source3/utils/net_offlinejoin.c | 4 ++++
 2 files changed, 5 insertions(+)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/util.c b/libcli/smb/util.c
index 297d463626c..c42b21a6fb9 100644
--- a/libcli/smb/util.c
+++ b/libcli/smb/util.c
@@ -267,6 +267,7 @@ static uint8_t *internal_bytes_push_str(uint8_t *buf, bool 
ucs2,
                                   ucs2 ? CH_UTF16LE : CH_DOS,
                                   str, str_len, &converted,
                                   &converted_size)) {
+               TALLOC_FREE(buf);
                TALLOC_FREE(frame);
                return NULL;
        }
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;
 }
 


-- 
Samba Shared Repository

Reply via email to