From 1817ac020ea58f03b038cf1bdca001d9683e2604 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 17 Mar 2011 15:35:42 +0200 Subject: [PATCH] Plug memory leaks on macro definition error cases --- rpmio/macro.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpmio/macro.c b/rpmio/macro.c index 201708306..98830d28a 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -535,7 +535,7 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody) rpmlog(RPMLOG_ERR, _("Macro %%%s has unterminated body\n"), n); se = s; /* XXX W2DO? */ - return se; + goto exit; } s++; /* XXX skip { */ strncpy(b, s, (se - s)); @@ -573,7 +573,7 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody) rpmlog(RPMLOG_ERR, _("Macro %%%s has unterminated body\n"), n); se = s; /* XXX W2DO? */ - return se; + goto exit; } /* Trim trailing blanks/newlines */ @@ -591,7 +591,7 @@ doDefine(MacroBuf mb, const char * se, int level, int expandbody) if (!((c = *n) && (risalpha(c) || c == '_') && (ne - n) > 2)) { rpmlog(RPMLOG_ERR, _("Macro %%%s has illegal name (%%define)\n"), n); - return se; + goto exit; } /* Options must be terminated with ')' */