From f54c7c454cc4f76cafb64975d22cdb69b4d1096d Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 19 Jan 2018 16:55:39 +0100 Subject: [PATCH] libpakfire: Fix SEGV when creating an empty Relation object Signed-off-by: Michael Tremer --- src/_pakfire/relation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.39.5