summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-01-04 12:20:09 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-01-04 12:45:18 +0200
commitf895acd285366cf58cc3c97b5f188fecbfd782a8 (patch)
tree5b329324796a06c3a1f79f908a2356842e845b46 /rpmio
parent2c5ea0b1889a86b8ec64e60c36ba42e909ebbdf7 (diff)
downloadlibrpm-tizen-f895acd285366cf58cc3c97b5f188fecbfd782a8.tar.gz
librpm-tizen-f895acd285366cf58cc3c97b5f188fecbfd782a8.tar.bz2
librpm-tizen-f895acd285366cf58cc3c97b5f188fecbfd782a8.zip
Always free locally defined macros when they go out of scope
- Prior to this, local defines in constructs like %{!?foo: %define foo bar} would remain defined until a parametrized macro gets called, causing obscure and confusing errors in specs such as RhBug:551971 and countless others. Use of %global is now always required for such constructs.
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/macro.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index 88fb58362..11db47d60 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -1344,9 +1344,8 @@ expandMacro(MacroBuf mb)
me->used++; /* Mark macro as used */
}
- /* Free args for "%name " macros with opts */
- if (me->opts != NULL)
- freeArgs(mb);
+ /* Free locally defined macros, such as macro options */
+ freeArgs(mb);
s = se;
}