From e569fed013e7e01b49b591b192eabdb0431b4976 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 27 Sep 2018 11:45:41 +0200 Subject: irmd: Add missing unlocks and avoid NULL dereference There were missing unlocks in certain error conditions and some NULL pointers were passed to strcmp which is undefined behavior. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/irmd/proc_table.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/irmd/proc_table.c') diff --git a/src/irmd/proc_table.c b/src/irmd/proc_table.c index 115eb2da..6f9d8e20 100644 --- a/src/irmd/proc_table.c +++ b/src/irmd/proc_table.c @@ -172,8 +172,7 @@ void proc_entry_del_name(struct proc_entry * e, struct str_el * s = list_entry(p, struct str_el, next); if (!strcmp(name, s->str)) { list_del(&s->next); - if (s->str != NULL) - free(s->str); + free(s->str); free(s); } } -- cgit v1.2.3