Blob Blame History Raw
commit f895acd285366cf58cc3c97b5f188fecbfd782a8
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Mon Jan 4 12:20:09 2010 +0200

    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.

diff --git a/rpmio/macro.c b/rpmio/macro.c
index 88fb583..11db47d 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;
     }