From: Joseph Sutton Date: Thu, 27 Jul 2023 20:14:27 +0000 (+1200) Subject: python: Fix leak X-Git-Tag: tevent-0.16.0~1196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b270333fe483e3cee1a70e8a313ec196966a5a0c;p=thirdparty%2Fsamba.git python: Fix leak Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/modules.c b/python/modules.c index ca563ff07d2..0b3cdb0681e 100644 --- a/python/modules.c +++ b/python/modules.c @@ -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);