From: Michael Tremer Date: Fri, 19 Jan 2018 15:55:39 +0000 (+0100) Subject: libpakfire: Fix SEGV when creating an empty Relation object X-Git-Tag: 0.9.28~1285^2~1156 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f54c7c454cc4f76cafb64975d22cdb69b4d1096d;p=pakfire.git libpakfire: Fix SEGV when creating an empty Relation object Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/relation.c b/src/_pakfire/relation.c index 0c0807be5..2459471db 100644 --- a/src/_pakfire/relation.c +++ b/src/_pakfire/relation.c @@ -35,7 +35,8 @@ static RelationObject* Relation_new_core(PyTypeObject* type, PakfireObject* pakf return NULL; self->pakfire = pakfire; - Py_INCREF(self->pakfire); + if (self->pakfire) + Py_INCREF(self->pakfire); self->relation = NULL;