X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fpool.c;h=41d4e74862cf703bc738039025e17d8818a9c102;hb=29c51e39acf3554a56aa2adc9451cc5fd70318ae;hp=336671e2bcd6b84c868f380e95608dbc76ad47b8;hpb=7b98b3a4f58f6dc5a8e9cbc188b627966d5e652d;p=pspp-builds.git diff --git a/src/pool.c b/src/pool.c index 336671e2..41d4e748 100644 --- a/src/pool.c +++ b/src/pool.c @@ -21,7 +21,7 @@ #include #endif #include "pool.h" -#include +#include "error.h" #include #include "alloc.h" #include "str.h" @@ -302,6 +302,8 @@ pool_strndup (struct pool *pool, const char *string, size_t length) copy = ((char *) b) + b->ofs; b->ofs += size; } + else + copy = pool_alloc (pool, size); } #else copy = pool_alloc (pool, size); @@ -641,6 +643,7 @@ free_all_gizmos (struct pool *pool) next = cur->next; free_gizmo (cur); } + pool->gizmos=NULL; } /* Memory allocation. */