]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/smb: Fix CID #710784 Resource leak
authorGünther Deschner <gd@samba.org>
Mon, 11 Aug 2025 14:58:51 +0000 (16:58 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 13 Aug 2025 00:48:41 +0000 (00:48 +0000)
buf was (re-)allocated on NULL context thus not part of frame that is
freed.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
libcli/smb/util.c

index 297d463626ccdf21ed8d4babb11700e0b9e66f4d..c42b21a6fb9f0d1c1589b1213a363382c372728d 100644 (file)
@@ -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;
        }