• src/smblib/smblib.c

    From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Thu Nov 19 09:20:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/ce3494e738760fd80e4c44f0
    Modified Files:
    src/smblib/smblib.c
    Log Message:
    smblib: free text_subtype/text_charset in smb_freemsghdrmem()

    smb_freemsghdrmem() ended with clear_convenience_ptrs(), which NULLs text_subtype and text_charset along with the pointers into header-field
    data. Those two are not such pointers: smb_parse_content_type() strdup()s
    them from a text/* Content-Type field, so they leaked each time a header
    with one was freed this way. MsgBase.put_msg_header() does that on every
    call (it re-reads the header and frees its fields before re-parsing the
    JS header object), leaking both strings per call; valgrind flagged it in
    the jsexec-testsuite-valgrind CI jobs.

    Free them alongside the header fields they are derived from.
    smb_freemsgmem() calls smb_freemsghdrmem(), so its own frees of the two
    are dropped.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>