diff options
author | Jon Medhurst <tixy@linaro.org> | 2014-10-30 18:01:15 +0000 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2014-10-30 18:04:22 +0000 |
commit | 96b56157b38cffced997ffa71fdd4bf71024fc67 (patch) | |
tree | b5d66817374fd6d39a295492f1a36a2a30b93486 /tools/gator/daemon/mxml/mxml-attr.c | |
parent | e31266f78058409d18d48e0afa8339e77322b17f (diff) |
gator: Version 5.20
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'tools/gator/daemon/mxml/mxml-attr.c')
-rw-r--r-- | tools/gator/daemon/mxml/mxml-attr.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tools/gator/daemon/mxml/mxml-attr.c b/tools/gator/daemon/mxml/mxml-attr.c index c9950f5fb732..8e89cc1474f8 100644 --- a/tools/gator/daemon/mxml/mxml-attr.c +++ b/tools/gator/daemon/mxml/mxml-attr.c @@ -1,9 +1,9 @@ /* - * "$Id: mxml-attr.c 408 2010-09-19 05:26:46Z mike $" + * "$Id: mxml-attr.c 451 2014-01-04 21:50:06Z msweet $" * * Attribute support code for Mini-XML, a small XML-like file parsing library. * - * Copyright 2003-2010 by Michael R Sweet. + * Copyright 2003-2014 by Michael R Sweet. * * These coded instructions, statements, and computer programs are the * property of Michael R Sweet and are protected by Federal copyright @@ -11,15 +11,7 @@ * which should have been included with this file. If this file is * 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. + * http://www.msweet.org/projects.php/Mini-XML */ /* @@ -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; } } @@ -315,5 +310,5 @@ mxml_set_attr(mxml_node_t *node, /* I - Element node */ /* - * End of "$Id: mxml-attr.c 408 2010-09-19 05:26:46Z mike $". + * End of "$Id: mxml-attr.c 451 2014-01-04 21:50:06Z msweet $". */ |