1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00

python: Fix leak

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton
2023-07-28 08:14:27 +12:00
committed by Andrew Bartlett
parent d0efff68ce
commit b270333fe4

View File

@@ -93,6 +93,7 @@ char **PyList_AsStringList(TALLOC_CTX *mem_ctx, PyObject *list,
PyObject *item = PyList_GetItem(list, i);
if (!PyUnicode_Check(item)) {
PyErr_Format(PyExc_TypeError, "%s should be strings", paramname);
talloc_free(ret);
return NULL;
}
value = PyUnicode_AsUTF8AndSize(item, &size);