]> granicus.if.org Git - procps-ng/commitdiff
vmstat: free before return
authorCraig Small <csmall@enc.com.au>
Tue, 3 May 2016 11:57:00 +0000 (21:57 +1000)
committerCraig Small <csmall@enc.com.au>
Tue, 3 May 2016 11:57:00 +0000 (21:57 +1000)
Previous commit the free was added after the return. That doesn't
work as planned.

References:
 commit 6151b794c6a4f1958dee81fb17bad83b65166c8f

vmstat.c

index 536776289fb2ef17956cc1a4dcc6b92923834b57..a5c62d6d2fcf026cb6bd0b5585e803bfea42befa 100644 (file)
--- a/vmstat.c
+++ b/vmstat.c
@@ -464,8 +464,8 @@ static int diskpartition_format(const char *partition_name)
         if (infinite_updates || i+1 < num_updates)
             sleep(sleep_time);
     }
-    return 0;
     procps_diskstat_unref(&disk_stat);
+    return 0;
 }
 
 static void diskheader(void)