mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Check for failure in allocations.
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user