From: Suchang Woo Date: Mon, 12 Oct 2015 07:59:56 +0000 (+0900) Subject: daemon: fix USE_AFTER_FREE issue X-Git-Tag: accepted/tizen/mobile/20151012.223240~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c534e1878450e7f3d7df4cfa488e00d72f4c3513;p=platform%2Fcore%2Fsystem%2Fbuxton2.git daemon: fix USE_AFTER_FREE issue Change-Id: I0ac80b247c38ced376a0fbf37d132247ef97bd9b Signed-off-by: Suchang Woo --- 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,