mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-13 07:15:30 +00:00
Fix memory leak and macro error (Bug #452)
This commit is contained in:
parent
6338dccaac
commit
129525f2b4
3
CHANGES
3
CHANGES
@ -1,4 +1,4 @@
|
||||
CHANGES - 2013-07-03
|
||||
CHANGES - 2013-11-11
|
||||
--------------------
|
||||
|
||||
CHANGES IN Mini-XML 2.8
|
||||
@ -6,6 +6,7 @@ CHANGES IN Mini-XML 2.8
|
||||
- Now call docsetutil using xcrun on OS X.
|
||||
- mxmldoc did not escape special HTML characters inside @code foo@
|
||||
comments.
|
||||
- Fixed a memory leak in mxmlElementDeleteAttr (STR #452)
|
||||
|
||||
|
||||
CHANGES IN Mini-XML 2.7
|
||||
|
13
mxml-attr.c
13
mxml-attr.c
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Attribute support code for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2010 by Michael R Sweet.
|
||||
* Copyright 2003-2013 by Michael R Sweet.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Michael R Sweet and are protected by Federal copyright
|
||||
@ -12,14 +12,6 @@
|
||||
* missing or damaged, see the license at:
|
||||
*
|
||||
* http://www.minixml.org/
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* mxmlElementDeleteAttr() - Delete an attribute.
|
||||
* mxmlElementGetAttr() - Get an attribute.
|
||||
* mxmlElementSetAttr() - Set an attribute.
|
||||
* mxmlElementSetAttrf() - Set an attribute with a formatted value.
|
||||
* mxml_set_attr() - Set or add an attribute name/value pair.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -90,6 +82,9 @@ mxmlElementDeleteAttr(mxml_node_t *node,/* I - Element */
|
||||
memmove(attr, attr + 1, i * sizeof(mxml_attr_t));
|
||||
|
||||
node->value.element.num_attrs --;
|
||||
|
||||
if (node->value.element.num_attrs == 0)
|
||||
free(node->value.element.attrs);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* String functions for Mini-XML, a small XML-like file parsing library.
|
||||
*
|
||||
* Copyright 2003-2010 by Michael R Sweet.
|
||||
* Copyright 2003-2013 by Michael R Sweet.
|
||||
*
|
||||
* These coded instructions, statements, and computer programs are the
|
||||
* property of Michael R Sweet and are protected by Federal copyright
|
||||
@ -12,14 +12,6 @@
|
||||
* missing or damaged, see the license at:
|
||||
*
|
||||
* http://www.minixml.org/
|
||||
*
|
||||
* Contents:
|
||||
*
|
||||
* _mxml_snprintf() - Format a string.
|
||||
* _mxml_strdup() - Duplicate a string.
|
||||
* _mxml_strdupf() - Format and duplicate a string.
|
||||
* _mxml_vsnprintf() - Format a string into a fixed size buffer.
|
||||
* _mxml_vstrdupf() - Format and duplicate a string.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -38,7 +30,7 @@
|
||||
# ifdef __va_copy
|
||||
# define va_copy(dst,src) __va_copy(dst,src)
|
||||
# else
|
||||
# define va_copy(dst,src) memcpy(&dst, &src, sizeof(va_list))
|
||||
# define va_copy(dst,src) memcpy(&dst, src, sizeof(va_list))
|
||||
# endif /* __va_copy */
|
||||
#endif /* va_copy */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user