cMark::Parse() mem leak

Fabian Wolter <[email protected]> Sun, 26 Oct 2025 08:22:16 +0100
Newsgroups gmane.linux.vdr
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------u0GAf8TuNmC2zqTxe0qy5sho
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I'm a bit hesitant to post this, because a mem leak in such old code 
seems quite unlikely. But Valgrind reports an error, and if I see 
correctly the strdup() is already done in cString::operator=(const char 
*String).

VDR 2.7.7

==92645== 168 bytes in 6 blocks are definitely lost in loss record 2,815 
of 3,354
==92645==    at 0x48850C8: malloc (vg_replace_malloc.c:381)
==92645==    by 0x4E68B2F: strdup (strdup.c:42)
==92645==    by 0x28F8EF: cMark::Parse(char const*) (recording.c:2288)
==92645==    by 0x29534B: cConfig<cMark>::Load(char const*, bool, bool) 
(config.h:158)
==92645==    by 0x28FD2B: cMarks::Update() (recording.c:2349)
==92645==    by 0x28FB4B: cMarks::Load(char const*, double, bool) 
(recording.c:2325)
==92645==    by 0x25B18B: cReplayControl::cReplayControl(bool) (menu.c:5748)
==92645==    by 0x2F9C03: main (vdr.c:1452)

Best regards,
Fabian
--------------u0GAf8TuNmC2zqTxe0qy5sho
Content-Type: text/plain; charset=UTF-8; name="fix-mark-parse-mem-leak.patch"
Content-Disposition: attachment; filename="fix-mark-parse-mem-leak.patch"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL3JlY29yZGluZy5jIGIvcmVjb3JkaW5nLmMKaW5kZXggOWRmMDA0Mjku
LjI0N2JhYTI1IDEwMDY0NAotLS0gYS9yZWNvcmRpbmcuYworKysgYi9yZWNvcmRpbmcuYwpA
QCAtMjI4NSw3ICsyMjg1LDcgQEAgYm9vbCBjTWFyazo6UGFyc2UoY29uc3QgY2hhciAqcykK
ICAgaWYgKHApIHsKICAgICAgcCA9IHNraXBzcGFjZShwKTsKICAgICAgaWYgKCpwKQotICAg
ICAgICBjb21tZW50ID0gc3RyZHVwKHApOworICAgICAgICBjb21tZW50ID0gcDsKICAgICAg
fQogICByZXR1cm4gdHJ1ZTsKIH0K

--------------u0GAf8TuNmC2zqTxe0qy5sho
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
vdr mailing list -- [email protected]
To unsubscribe send an email to [email protected]

--------------u0GAf8TuNmC2zqTxe0qy5sho--