From cd4036cb63d19296476e1e91056a6524ade9bbbc Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Mon, 29 Apr 2024 07:56:55 +0530 Subject: c: don't NULL check before free --- src/npassd/collection.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/npassd/collection.c') diff --git a/src/npassd/collection.c b/src/npassd/collection.c index 48167bf..6fecf16 100644 --- a/src/npassd/collection.c +++ b/src/npassd/collection.c @@ -45,17 +45,12 @@ static void collection_free(struct collection *c) if (c == NULL) return; - if (c->slot != NULL) - sd_bus_slot_unref(c->slot); - if (c->path != NULL) - free(c->path); - if (c->alias != NULL) - free(c->alias); - if (c->label != NULL) - free(c->label); - if (c->root != NULL) - free(c->root); + sd_bus_slot_unref(c->slot); + free(c->path); + free(c->alias); + free(c->label); + free(c->root); free(c); } -- cgit v1.2.3