From: Stas Cymbalov Date: Mon, 3 Apr 2017 20:51:19 +0000 (+0300) Subject: Fix memory leaks X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=14e76463c6431e7d3f5aca988c283e5cb65c1190;p=pmount-gui.git Fix memory leaks Free unused members of `nodes' array on early loop exit. Free string array `fstab'. Remove unused variable `mounted'. --- diff --git a/main.c b/main.c index 8f939e6..76632ab 100644 --- a/main.c +++ b/main.c @@ -542,7 +542,6 @@ Device *get_devices(void) char **nodes = NULL; Device *devices = NULL; int n_devices = 0; - char **mounted = NULL; char **fstab = NULL; int i; @@ -561,6 +560,7 @@ Device *get_devices(void) { if(verbosity>=2) printf(" No properties\n"); + free(nodes[i]); continue; } @@ -626,7 +626,7 @@ Device *get_devices(void) } free(nodes); - free_string_array(mounted); + free_string_array(fstab); if(devices) {