From 1340a8867f91582d6eeec95b2195a01d5548a6fc Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 23 Apr 2012 13:32:37 +0000 Subject: [PATCH] JAM: fix memory leak in daq_disk demon --- disks/disks.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/disks/disks.c b/disks/disks.c index 675c187..a767877 100644 --- a/disks/disks.c +++ b/disks/disks.c @@ -177,9 +177,10 @@ static int checkDisks(TheArgs *theArgs) FILE* stream = popen("/bin/df -m", "r"); char **array; + void* base; array = malloc( sizeof(char *) * BUFLEN ); assert(array != NULL); - + base=array; count = 0; while (1) @@ -239,6 +240,8 @@ static int checkDisks(TheArgs *theArgs) } } + free(base); + return 0; } -- 2.43.0