rfkill: Fix a memory leak
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 15 Feb 2016 22:14:47 +0000 (00:14 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 15 Feb 2016 22:14:47 +0000 (00:14 +0200)
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>
src/drivers/rfkill.c

index 464cf78..4d4d1b4 100644 (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;