From: Jim Warner Date: Wed, 11 May 2016 21:16:16 +0000 (-0500) Subject: ps: ensuring procps_meminfo_new success, api X-Git-Tag: v4.0.0~911 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78043f67511a87ae30ca8fa15168ee75ba5c3fab;p=procps-ng 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 --- 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"));