diff --git a/lib/sample.c b/lib/sample.c index 21e2c2f5a..58c71f9f3 100644 --- a/lib/sample.c +++ b/lib/sample.c @@ -43,7 +43,11 @@ int sample_init(struct sample *s) struct sample * sample_alloc(struct pool *p) { - struct sample *s = pool_get(p); + struct sample *s; + + s = pool_get(p); + if (!s) + return NULL; s->pool_off = (char *) p - (char *) s;