From c534e1878450e7f3d7df4cfa488e00d72f4c3513 Mon Sep 17 00:00:00 2001 From: Suchang Woo Date: Mon, 12 Oct 2015 16:59:56 +0900 Subject: [PATCH] daemon: fix USE_AFTER_FREE issue Change-Id: I0ac80b247c38ced376a0fbf37d132247ef97bd9b Signed-off-by: Suchang Woo --- daemon/daemon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/daemon.c b/daemon/daemon.c index 416cf90..b8df6a1 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -425,10 +425,8 @@ static void proc_unnotify(struct bxt_client *cli, } noti = g_hash_table_lookup(cli->bxtd->notis, lykey); - - free(lykey); - if (!noti) { + free(lykey); resp->res = ENOENT; return; } @@ -442,6 +440,8 @@ static void proc_unnotify(struct bxt_client *cli, g_hash_table_remove(cli->bxtd->notis, lykey); resp->res = 0; + + free(lykey); } static void proc_set_priv(struct bxt_client *cli, -- 2.7.4