From: Michael Tremer Date: Thu, 14 Sep 2023 11:49:06 +0000 (+0000) Subject: _pakfire: util: Fix SEGV when we could not read from file X-Git-Tag: 0.9.29~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75d016f6a8f4e2c0af5ea85b07c8e29eb939dd71;p=pakfire.git _pakfire: util: Fix SEGV when we could not read from file Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/util.c b/src/_pakfire/util.c index 4642f8329..e661a178b 100644 --- a/src/_pakfire/util.c +++ b/src/_pakfire/util.c @@ -179,7 +179,8 @@ static ssize_t PyObject_AsFileHandle_read(void* cookie, char* buffer, size_t siz memcpy(buffer, bytes, bytes_read); ERROR: - Py_DECREF(pybuffer); + if (pybuffer) + Py_DECREF(pybuffer); // Release the GIL PyGILState_Release(state);