From 415c593ad52e0c5fbf317b52baa2b8eb42bfc805 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Thu, 6 Oct 2011 10:02:06 -0500 Subject: [PATCH] redhat analysis: vmstat --- vmstat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vmstat.c b/vmstat.c index e0d3c23f..756ec4f9 100644 --- a/vmstat.c +++ b/vmstat.c @@ -303,6 +303,8 @@ static int diskpartition_format(const char* partition_name){ } } if(!current_partition){ + free(disks); + free(partitions); return -1; } diskpartition_header(partition_name); @@ -323,6 +325,8 @@ static int diskpartition_format(const char* partition_name){ } } if(!current_partition){ + free(disks); + free(partitions); return -1; } printf (format, @@ -422,7 +426,7 @@ static void slabformat (void){ fSlab=fopen("/proc/slabinfo", "rb"); if(!fSlab){ - fprintf(stderr, "Your kernel doesn't support slabinfo.\n"); + fprintf(stderr, "Your kernel doesn't support slabinfo or your permissions are insufficient.\n"); return; } @@ -454,6 +458,7 @@ static void slabformat (void){ } free(slabs); } + free(fSlab); } ////////////////////////////////////////////////////////////////////////////