From 99a17351c7c1ab70a4c1ee53a83f56977a3df047 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 16 Feb 2016 00:14:47 +0200 Subject: [PATCH] rfkill: Fix a memory leak rfkill_init() uses realpath() which allocates memory and that memory was not freed on the success path. Signed-off-by: Jouni Malinen --- src/drivers/rfkill.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drivers/rfkill.c b/src/drivers/rfkill.c index 464cf7834..4d4d1b448 100644 --- a/src/drivers/rfkill.c +++ b/src/drivers/rfkill.c @@ -185,6 +185,7 @@ struct rfkill_data * rfkill_init(struct rfkill_config *cfg) if (!found) goto fail2; + free(phy); eloop_register_read_sock(rfkill->fd, rfkill_receive, rfkill, NULL); return rfkill;