0011-python-free-internal-string-buffer-if-needed-in-set_.patch
bindings/python/wrapper_top.c | ||
---|---|---|
332 | 332 |
l = PySequence_Length(seq); |
333 | 333 |
} |
334 | 334 |
for (i=0; i<l; i++) { |
335 |
const char *astr = NULL; |
|
336 | ||
335 | 337 |
PyObject *pystr = PySequence_Fast_GET_ITEM(seq, i); |
336 | 338 |
if (! PyString_Check(pystr)) { |
337 | 339 |
PyErr_SetString(PyExc_TypeError, |
338 | 340 |
"value should be a tuple of strings"); |
339 | 341 |
goto failure; |
340 | 342 |
} |
341 |
list = g_list_append(list, g_strdup(PyString_AsString(pystr))); |
|
343 |
astr = PyString_AsString(pystr); |
|
344 |
list = g_list_append(list, g_strdup(astr)); |
|
345 |
PyStringFree(astr); |
|
342 | 346 |
} |
343 | 347 |
free_list(a_list, (GFunc)g_free); |
344 | 348 |
*a_list = list; |
345 |
- |