summaryrefslogtreecommitdiff
path: root/lib/resource.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-09-16 23:57:40 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2013-09-16 23:57:40 +0200
commit6a8d3f1c1ffbd964e4d11b452c73e1ea70310af3 (patch)
treeffad2ba5c281d87ec64f3b9f419b17251ef616a6 /lib/resource.c
parentbf139664aa2ae9956b520ba4813bb6e03bf1a3e8 (diff)
BFD work in progress.
Now it compiles and mostly works.
Diffstat (limited to 'lib/resource.c')
-rw-r--r--lib/resource.c5
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;
}