Memory leak in libmxml1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mxml (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
There is a memory leak in mxmlDelete, already reported [https:/
leak.cpp:
#include <mxml.h>
int main(int, char const*[])
{
mxml_node_t *pDoc = mxmlNewXML("1.0");
mxml_node_t *pRoot = mxmlNewElement(
mxml_node_t *pNode1 = mxmlNewElement(
mxmlDelete(
return 0;
}
$ LDLIBS=-lmxml CPPFLAGS=-g make leak
$ valgrind --leak-check=full ./leak
==24403== Memcheck, a memory error detector
==24403== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==24403== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==24403== Command: ./leak
==24403==
==24403==
==24403== HEAP SUMMARY:
==24403== in use at exit: 93 bytes in 2 blocks
==24403== total heap usage: 6 allocs, 4 frees, 311 bytes allocated
==24403==
==24403== 93 (88 direct, 5 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 2
==24403== at 0x4C31B25: calloc (in /usr/lib/
==24403== by 0x4E43F58: ??? (in /usr/lib/
==24403== by 0x4E44024: mxmlNewElement (in /usr/lib/
==24403== by 0x1087DB: main (leak.cpp:6)
==24403==
==24403== LEAK SUMMARY:
==24403== definitely lost: 88 bytes in 1 blocks
==24403== indirectly lost: 5 bytes in 1 blocks
==24403== possibly lost: 0 bytes in 0 blocks
==24403== still reachable: 0 bytes in 0 blocks
==24403== suppressed: 0 bytes in 0 blocks
==24403==
==24403== For counts of detected and suppressed errors, rerun with: -v
==24403== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libmxml1 2.10-1
ProcVersionSign
Uname: Linux 4.15.0-23-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
Date: Fri Aug 10 07:53:31 2018
SourcePackage: mxml
UpgradeStatus: No upgrade log present (probably fresh install)
Status changed to 'Confirmed' because the bug affects multiple users.