From: Douglas Bagnall Date: Thu, 27 May 2021 03:32:45 +0000 (+1200) Subject: s3:pylibsmb: avoid small leaks in cli_notify_get_changes X-Git-Tag: tevent-0.11.0~444 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef863de140d2b5243e753f793bd0b0680334df2f;p=thirdparty%2Fsamba.git s3:pylibsmb: avoid small leaks in cli_notify_get_changes Signed-off-by: Douglas Bagnall Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 16076485153..38dc5ecb8df 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -1330,12 +1330,15 @@ static PyObject *py_cli_notify_get_changes(struct py_cli_notify_state *self, "name", changes[i].name, "action", changes[i].action); if (change == NULL) { + Py_XDECREF(result); TALLOC_FREE(req); return NULL; } ret = PyList_Append(result, change); + Py_DECREF(change); if (ret == -1) { + Py_XDECREF(result); TALLOC_FREE(req); return NULL; }