From b54d2dde407921caa7561dde6b45831ba93d0840 Mon Sep 17 00:00:00 2001 From: Hisham Date: Tue, 2 Feb 2016 15:53:02 +0100 Subject: Check for failure in allocations. --- darwin/DarwinProcessList.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'darwin/DarwinProcessList.c') diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index deafc5f3..7ea89d9f 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -87,7 +87,7 @@ struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count) { if (sysctl(mib, 4, NULL, count, NULL, 0) < 0) CRT_fatalError("Unable to get size of kproc_infos"); - processes = malloc(*count); + processes = xMalloc(*count); if (processes == NULL) CRT_fatalError("Out of memory for kproc_infos"); @@ -101,7 +101,7 @@ struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count) { ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) { - DarwinProcessList* this = calloc(1, sizeof(DarwinProcessList)); + DarwinProcessList* this = xCalloc(1, sizeof(DarwinProcessList)); ProcessList_init(&this->super, Class(Process), usersTable, pidWhiteList, userId); -- cgit v1.2.3