Now correctly freeing xml variable in ag_app_open_chart()
This commit is contained in:
parent
ed14c5b092
commit
142f3b2374
@ -219,6 +219,7 @@ ag_app_open_chart(AgApp *app, GFile *file)
|
|||||||
if ((doc = xmlReadMemory(xml, length, "chart.xml", NULL, 0)) == NULL) {
|
if ((doc = xmlReadMemory(xml, length, "chart.xml", NULL, 0)) == NULL) {
|
||||||
// TODO: Warn with a popup or similar way
|
// TODO: Warn with a popup or similar way
|
||||||
g_warning("Saved chart is corrupt (or not a saved chart at all)");
|
g_warning("Saved chart is corrupt (or not a saved chart at all)");
|
||||||
|
g_free(xml);
|
||||||
g_free(uri);
|
g_free(uri);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -228,6 +229,7 @@ ag_app_open_chart(AgApp *app, GFile *file)
|
|||||||
// TODO: Warn with a popup or similar way
|
// TODO: Warn with a popup or similar way
|
||||||
g_warning("Could not initialize XPath");
|
g_warning("Could not initialize XPath");
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
|
g_free(xml);
|
||||||
g_free(uri);
|
g_free(uri);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -259,6 +261,7 @@ ag_app_open_chart(AgApp *app, GFile *file)
|
|||||||
g_variant_unref(minute);
|
g_variant_unref(minute);
|
||||||
g_variant_unref(second);
|
g_variant_unref(second);
|
||||||
|
|
||||||
|
g_free(xml);
|
||||||
g_free(uri);
|
g_free(uri);
|
||||||
xmlXPathFreeContext(xpathCtx);
|
xmlXPathFreeContext(xpathCtx);
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
|
Loading…
Reference in New Issue
Block a user