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 /Affinity.c | |
parent | a1f7f2869ec2bd860d5b4e4b39736ca877afdf6f (diff) |
Check for failure in allocations.
Diffstat (limited to 'Affinity.c')
-rw-r--r-- | Affinity.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -29,9 +29,9 @@ typedef struct Affinity_ { }*/ Affinity* Affinity_new(ProcessList* pl) { - Affinity* this = calloc(1, sizeof(Affinity)); + Affinity* this = xCalloc(1, sizeof(Affinity)); this->size = 8; - this->cpus = calloc(this->size, sizeof(int)); + this->cpus = xCalloc(this->size, sizeof(int)); this->pl = pl; return this; } @@ -44,7 +44,7 @@ void Affinity_delete(Affinity* this) { void Affinity_add(Affinity* this, int id) { if (this->used == this->size) { this->size *= 2; - this->cpus = realloc(this->cpus, sizeof(int) * this->size); + this->cpus = xRealloc(this->cpus, sizeof(int) * this->size); } this->cpus[this->used] = id; this->used++; |