ps: ensuring procps_meminfo_new success, <MEMINFO> 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 <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2016-05-11 16:16:16 -05:00 committed by Craig Small
parent 93a60022dc
commit 78043f6751

View File

@ -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"));