Add proper check of allocation for testing object.
This commit is contained in:
1 parent
dc92ad9c02
commit
494ee2c099
1 file changed
+1
@@ -30,6 +30,7 @@ static void testobj_init_set(testobj_t d, const testobj_t s)
|
|||||||
d->n = s->n;
|
d->n = s->n;
|
||||||
d->a = s->n;
|
d->a = s->n;
|
||||||
d->ptr = (unsigned int *) calloc (s->n, sizeof(unsigned int));
|
d->ptr = (unsigned int *) calloc (s->n, sizeof(unsigned int));
|
||||||
|
if (!d->ptr) abort();
|
||||||
memcpy(d->ptr, s->ptr, sizeof(unsigned int) * s->n);
|
memcpy(d->ptr, s->ptr, sizeof(unsigned int) * s->n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user