summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/rpmmacro-py.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/rpmmacro-py.c b/python/rpmmacro-py.c
index cc4965aa0..a056998d2 100644
--- a/python/rpmmacro-py.c
+++ b/python/rpmmacro-py.c
@@ -52,11 +52,15 @@ rpmmacro_DelMacro(PyObject * self, PyObject * args, PyObject * kwds)
PyObject *
rpmmacro_ExpandMacro(PyObject * self, PyObject * args, PyObject * kwds)
{
- char * macro;
+ char *macro, *str;
+ PyObject *res;
if (!PyArg_ParseTuple(args, "s", &macro))
return NULL;
- return Py_BuildValue("s", rpmExpand(macro, NULL));
+ str = rpmExpand(macro, NULL);
+ res = Py_BuildValue("s", str);
+ free(str);
+ return res;
}