Add proper check of allocation for testing object.

This commit is contained in:
Patrick Pelissier committed 2018-05-22 05:46:04 +02:00
1 parent dc92ad9c02
commit 494ee2c099
1 file changed
+1
+1
View File
@@ -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);
} }