[Rpm-maint] [rpm-software-management/rpm] Add new rpmExpandThisMacro() public method (#1414)

Panu Matilainen notifications at github.com
Tue Oct 27 10:10:53 UTC 2020


@pmatilai commented on this pull request.



> -
-	/* Recursively expand body of macro */
-	if (me->body && *me->body) {
-	    if ((me->flags & ME_LITERAL) != 0)
-		mbAppendStr(mb, me->body);
-	    else
-		expandMacro(mb, me->body, 0);
-	}
-
-	/* Free args for "%name " macros with opts */
-	if (args != NULL)
-	    freeArgs(mb);
-	mb->args = prevarg;
-	mb->me = prevme;
-
+	doExpandThisMacro(mb, me, args);

Oh, the other thing is that this *looks* a lot like a memory leak, as the argv free is buried far away from here. I'd prefer symmetry here - args was initially allocated here so it should also be freed here, ditto with optargs in expandThisMacro().

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1414#pullrequestreview-517535379
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201027/ad8bcaf8/attachment.html>


More information about the Rpm-maint mailing list