From b1379237988f02714422d149ecbd2044cb9c6ad8 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sun, 7 Feb 2010 08:28:20 -0500 Subject: [PATCH] Fixed a potential memory leak with IMPORT. --- src/xml.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xml.c b/src/xml.c index c369d59c..81701747 100644 --- a/src/xml.c +++ b/src/xml.c @@ -493,6 +493,9 @@ xmlNodePtr find_account(xmlDocPtr doc, gchar ***req, gpg_error_t *rc, content = node_has_attribute(n, (xmlChar *)"target"); if (!content || stop) { + if (content) + xmlFree(content); + g_free(account); return n; } @@ -516,6 +519,7 @@ xmlNodePtr find_account(xmlDocPtr doc, gchar ***req, gpg_error_t *rc, g_strfreev(nreq); if (!tmp) { + g_free(account); *rc = gpg_error_from_errno(ENOMEM); return NULL; } @@ -526,6 +530,7 @@ xmlNodePtr find_account(xmlDocPtr doc, gchar ***req, gpg_error_t *rc, else { if (strv_printf(&tmp, "%s", content) == FALSE) { xmlFree(content); + g_free(account); *rc = gpg_error_from_errno(ENOMEM); return NULL; } @@ -537,6 +542,7 @@ xmlNodePtr find_account(xmlDocPtr doc, gchar ***req, gpg_error_t *rc, if (!nreq) { *rc = gpg_error_from_errno(ENOMEM); + g_free(account); return NULL; } -- 2.11.4.GIT