diff options
| author | mbkma <[email protected]> | 2026-03-07 21:50:30 +0100 |
|---|---|---|
| committer | mbkma <[email protected]> | 2026-03-07 21:50:30 +0100 |
| commit | a6b7e697df2902e6a10b12a2e01efa375e8df9e7 (patch) | |
| tree | 8e930382b149abb286642ad41ca9ab016f41a730 | |
| parent | 01ba5fede9ab601002c4e4d122b0585e16b3f3ce (diff) | |
| download | pluma-fix-taglist-plugin.tar.bz2 pluma-fix-taglist-plugin.tar.xz | |
taglist-plugin: fix free(): invalid pointerfix-taglist-plugin
| -rw-r--r-- | plugins/taglist/pluma-taglist-plugin-parser.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/plugins/taglist/pluma-taglist-plugin-parser.c b/plugins/taglist/pluma-taglist-plugin-parser.c index 74693290..d97553b9 100644 --- a/plugins/taglist/pluma-taglist-plugin-parser.c +++ b/plugins/taglist/pluma-taglist-plugin-parser.c @@ -140,7 +140,11 @@ parse_tag_group (TagGroup *tg, const gchar* fn, xmlDocPtr doc, tag = g_new0 (Tag, 1); /* Get Tag name */ - tag->name = (xmlChar*)gettext((const char*)xmlGetProp (cur, (const xmlChar *) "name")); + { + xmlChar *prop = xmlGetProp (cur, (const xmlChar *) "name"); + tag->name = (xmlChar*)g_strdup (gettext ((const char*)prop)); + xmlFree (prop); + } if (tag->name == NULL) { @@ -196,7 +200,11 @@ get_tag_group (const gchar* filename, xmlDocPtr doc, tag_group = g_new0 (TagGroup, 1); /* Get TagGroup name */ - tag_group->name = (xmlChar*)gettext((const char*)xmlGetProp (cur, (const xmlChar *) "name")); + { + xmlChar *prop = xmlGetProp (cur, (const xmlChar *) "name"); + tag_group->name = (xmlChar*)g_strdup (gettext ((const char*)prop)); + xmlFree (prop); + } sort_str = xmlGetProp (cur, (const xmlChar *) "sort"); @@ -499,13 +507,13 @@ free_tag (Tag *tag) */ g_return_if_fail (tag != NULL); - free (tag->name); + g_free (tag->name); if (tag->begin != NULL) - free (tag->begin); + xmlFree (tag->begin); if (tag->end != NULL) - free (tag->end); + xmlFree (tag->end); g_free (tag); } @@ -519,7 +527,7 @@ free_tag_group (TagGroup *tag_group) g_return_if_fail (tag_group != NULL); - free (tag_group->name); + g_free (tag_group->name); for (l = tag_group->tags; l != NULL; l = g_list_next (l)) { |
