mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-13 07:15:30 +00:00
Fix memory leak when loading a badly-formed XML file (STR #121)
This commit is contained in:
parent
7f6103a0df
commit
682852c289
3
CHANGES
3
CHANGES
@ -1,4 +1,4 @@
|
||||
CHANGES - 2011-01-14
|
||||
CHANGES - 2011-03-23
|
||||
--------------------
|
||||
|
||||
CHANGES IN Mini-XML 2.7
|
||||
@ -9,6 +9,7 @@ CHANGES IN Mini-XML 2.7
|
||||
header to preserve source compatibility (STR #118)
|
||||
- Updated the source headers to reference the Mini-XML license and its
|
||||
exceptions to the LGPL2 (STR #108)
|
||||
- Fixed a memory leak when loading a badly-formed XML file (STR #121)
|
||||
- Added a new mxmlFindPath() function to find the value node of a
|
||||
named element (STR #110)
|
||||
- Building a static version of the library did not work on Windows
|
||||
|
@ -373,6 +373,10 @@ testmxml: libmxml.a testmxml.o
|
||||
echo File descriptor test failed!; \
|
||||
fi
|
||||
|
||||
testmxml-vg: $(LIBOBJS) testmxml.o
|
||||
echo Linking $@...
|
||||
$(CC) $(LDFLAGS) -o $@ testmxml.o $(LIBOBJS) $(LIBS)
|
||||
|
||||
testmxml.o: mxml.h
|
||||
|
||||
|
||||
|
21
mxml-file.c
21
mxml-file.c
@ -1565,19 +1565,22 @@ mxml_load_data(
|
||||
|
||||
if (ch == '<' && whitespace && type == MXML_TEXT)
|
||||
{
|
||||
node = mxmlNewText(parent, whitespace, "");
|
||||
|
||||
if (sax_cb)
|
||||
if (parent)
|
||||
{
|
||||
(*sax_cb)(node, MXML_SAX_DATA, sax_data);
|
||||
node = mxmlNewText(parent, whitespace, "");
|
||||
|
||||
if (!mxmlRelease(node))
|
||||
node = NULL;
|
||||
if (sax_cb)
|
||||
{
|
||||
(*sax_cb)(node, MXML_SAX_DATA, sax_data);
|
||||
|
||||
if (!mxmlRelease(node))
|
||||
node = NULL;
|
||||
}
|
||||
|
||||
if (!first && node)
|
||||
first = node;
|
||||
}
|
||||
|
||||
if (!first && node)
|
||||
first = node;
|
||||
|
||||
whitespace = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user