Commit e54f87a0 authored by Cedric Roux's avatar Cedric Roux
Browse files

bugfix: forgot malloc return check

parent 8cca28b3
...@@ -459,7 +459,7 @@ int database_get_ids(void *_d, char ***ids) ...@@ -459,7 +459,7 @@ int database_get_ids(void *_d, char ***ids)
{ {
database *d = _d; database *d = _d;
int i; int i;
*ids = malloc(d->isize * sizeof(char **)); *ids = malloc(d->isize * sizeof(char **)); if (*ids == NULL) abort();
for (i = 0; i < d->isize; i++) (*ids)[i] = d->i[i].name; for (i = 0; i < d->isize; i++) (*ids)[i] = d->i[i].name;
return d->isize; return d->isize;
} }
...@@ -468,7 +468,7 @@ int database_get_groups(void *_d, char ***groups) ...@@ -468,7 +468,7 @@ int database_get_groups(void *_d, char ***groups)
{ {
database *d = _d; database *d = _d;
int i; int i;
*groups = malloc(d->gsize * sizeof(char **)); *groups = malloc(d->gsize * sizeof(char **)); if (*groups == NULL) abort();
for (i = 0; i < d->gsize; i++) (*groups)[i] = d->g[i].name; for (i = 0; i < d->gsize; i++) (*groups)[i] = d->g[i].name;
return d->gsize; return d->gsize;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment