From: Michael Tremer Date: Tue, 17 Nov 2020 18:34:51 +0000 (+0000) Subject: database: Do not clean up python list X-Git-Tag: 0.9.5~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c98ebf8aae2aa141193db52cd9429b1ded5b09c4;p=location%2Flibloc.git database: Do not clean up python list Signed-off-by: Michael Tremer --- diff --git a/src/python/database.c b/src/python/database.c index 38a804c..ed22275 100644 --- a/src/python/database.c +++ b/src/python/database.c @@ -325,9 +325,14 @@ static PyObject* Database_search_networks(DatabaseObject* self, PyObject* args, loc_country_unref(country); } - loc_database_enumerator_set_countries(enumerator, countries); + r = loc_database_enumerator_set_countries(enumerator, countries); + if (r) { + PyErr_SetFromErrno(PyExc_SystemError); + + loc_as_list_unref(countries); + return NULL; + } - Py_DECREF(country_codes); loc_country_list_unref(countries); }