From: hadaq Date: Mon, 23 Apr 2012 13:32:37 +0000 (+0000) Subject: JAM: fix memory leak in daq_disk demon X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=1340a8867f91582d6eeec95b2195a01d5548a6fc;p=daqdata.git JAM: fix memory leak in daq_disk demon --- 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; }