extract.c: Fix dereference of NULL in memory exhausted path