mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 02:30:35 +00:00
Fix leak in gst_flow_get_name() wrapper function. Fixes #574251
PyString_FromString will make a copy of the provided string.
This commit is contained in:
parent
61b534042c
commit
92f2e4d540
1 changed files with 2 additions and 5 deletions
|
@ -722,17 +722,14 @@ _wrap_gst_flow_get_name(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||||
static char *kwlist[] = { "ret", NULL };
|
static char *kwlist[] = { "ret", NULL };
|
||||||
PyObject *py_ret = NULL;
|
PyObject *py_ret = NULL;
|
||||||
const gchar *ret;
|
const gchar *ret;
|
||||||
gchar *nret;
|
|
||||||
GstFlowReturn flow;
|
GstFlowReturn flow;
|
||||||
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gst_flow_get_name", kwlist, &py_ret))
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gst_flow_get_name", kwlist, &py_ret))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (pyg_enum_get_value(GST_TYPE_FLOW_RETURN, py_ret, (gint *)&flow))
|
if (pyg_enum_get_value(GST_TYPE_FLOW_RETURN, py_ret, (gint *)&flow))
|
||||||
return NULL;
|
return NULL;
|
||||||
ret = gst_flow_get_name(flow);
|
if ((ret = gst_flow_get_name(flow))) {
|
||||||
if (ret) {
|
return PyString_FromString(ret);
|
||||||
nret = g_strdup(ret);
|
|
||||||
return PyString_FromString(nret);
|
|
||||||
}
|
}
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
|
|
Loading…
Reference in a new issue