]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python: Fix leak
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 27 Jul 2023 20:14:27 +0000 (08:14 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Aug 2023 04:39:37 +0000 (04:39 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/modules.c

index ca563ff07d2db1ddf6417e770b1c494243fce26c..0b3cdb0681e5d50f8f4c47ba4a64ed676da4ab69 100644 (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);