Decrement reference count

This commit is contained in:
Andrew Murray 2022-05-24 19:23:31 +10:00
parent 26c79343ec
commit 879cd71c3f

View File

@ -372,7 +372,9 @@ fname2char(PyObject *fname) {
if (bytes == NULL) {
return NULL;
}
return PyBytes_AsString(bytes);
char* libname = PyBytes_AsString(bytes);
Py_DECREF(bytes);
return libname;
}
#include <dlfcn.h>