X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fcategory.c;h=509085497ab01fb39f6a6d0f5b4bce7f102a8984;hb=37736728bbb526a27145a757836bd8b64e8adf6f;hp=e48987a043ded9bd16012145eb69bb7840149dc9;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp diff --git a/src/data/category.c b/src/data/category.c index e48987a043..509085497a 100644 --- a/src/data/category.c +++ b/src/data/category.c @@ -33,9 +33,8 @@ */ #include #include -#include -#include "alloc.h" -#include "message.h" +#include +#include #include "category.h" #include "cat-routines.h" #include @@ -60,9 +59,16 @@ void cat_stored_values_destroy (struct variable *v) { assert (v != NULL); + if (v->obs_vals != NULL) { + if (v->obs_vals->n_allocated_categories > 0) + { + free (v->obs_vals->vals); + v->obs_vals->vals = NULL; + } free (v->obs_vals); + v->obs_vals = NULL; } }