diff options
Diffstat (limited to 'lib/resource.c')
-rw-r--r-- | lib/resource.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/resource.c b/lib/resource.c index 775b0c53..bf4b3ae9 100644 --- a/lib/resource.c +++ b/lib/resource.c @@ -220,7 +220,8 @@ ralloc(pool *p, struct resclass *c) bzero(r, c->size); r->class = c; - add_tail(&p->inside, &r->n); + if (p) + add_tail(&p->inside, &r->n); return r; } @@ -423,6 +424,6 @@ buffer_realloc(void **buf, unsigned *size, unsigned need, unsigned item_size) while (nsize < need) nsize = STEP_UP(nsize); - *buf = mb_realloc(*buf, nsize*isize); + *buf = mb_realloc(*buf, nsize * item_size); *size = nsize; } |