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 <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-02-16 00:14:47 +02:00 committed by Jouni Malinen
parent 1f1e599b3b
commit 99a17351c7

View file

@ -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;