From 78043f67511a87ae30ca8fa15168ee75ba5c3fab Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Wed, 11 May 2016 16:16:16 -0500 Subject: [PATCH] ps: ensuring procps_meminfo_new success, api The 'new' function requires a NULL context pointer, so when existing code worked, it was just a case of luck. Signed-off-by: Jim Warner --- ps/output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ps/output.c b/ps/output.c index 5bc93f8a..f7ac3cee 100644 --- a/ps/output.c +++ b/ps/output.c @@ -100,7 +100,7 @@ static void get_boot_time(void) static void get_memory_total() { - struct procps_meminfo *mem_info; + struct procps_meminfo *mem_info = NULL; if (procps_meminfo_new(&mem_info) < 0) xerrx(EXIT_FAILURE, _("Unable to create meminfo structure"));