Plug memory leaks on macro definition error cases

This commit is contained in:
Panu Matilainen 2011-03-17 15:35:42 +02:00
parent 8ec147d322
commit 1817ac020e
1 changed files with 3 additions and 3 deletions

View File

@ -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 ')' */