From 92f2e4d5401a1ff020f9d22263a4621fa9f57371 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 5 Mar 2009 13:21:19 +0100 Subject: [PATCH] Fix leak in gst_flow_get_name() wrapper function. Fixes #574251 PyString_FromString will make a copy of the provided string. --- gst/gst.override | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gst/gst.override b/gst/gst.override index 8e2734c959..0da60a2c34 100644 --- a/gst/gst.override +++ b/gst/gst.override @@ -722,17 +722,14 @@ _wrap_gst_flow_get_name(PyObject *self, PyObject *args, PyObject *kwargs) static char *kwlist[] = { "ret", NULL }; PyObject *py_ret = NULL; const gchar *ret; - gchar *nret; GstFlowReturn flow; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gst_flow_get_name", kwlist, &py_ret)) return NULL; if (pyg_enum_get_value(GST_TYPE_FLOW_RETURN, py_ret, (gint *)&flow)) return NULL; - ret = gst_flow_get_name(flow); - if (ret) { - nret = g_strdup(ret); - return PyString_FromString(nret); + if ((ret = gst_flow_get_name(flow))) { + return PyString_FromString(ret); } Py_INCREF(Py_None); return Py_None;