diff options
author | Hisham <hisham@gobolinux.org> | 2016-02-02 15:53:02 +0100 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-02-02 15:53:02 +0100 |
commit | b54d2dde407921caa7561dde6b45831ba93d0840 (patch) | |
tree | cd81eea35dd65e46d22f2801ea403e1efc06eb59 /darwin/DarwinProcessList.c | |
parent | a1f7f2869ec2bd860d5b4e4b39736ca877afdf6f (diff) |
Check for failure in allocations.
Diffstat (limited to 'darwin/DarwinProcessList.c')
-rw-r--r-- | darwin/DarwinProcessList.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |