X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fcategoricals.c;h=33e3b51c62f99cc2290ce7918dbba6aedb111878;hb=34bf67fbfdce409a1cefdc101518c633636c1f43;hp=6002d8c179aa09529fa7740a676ab7329f2255fa;hpb=7ed3007256a3aa949995f26da3acdbfe279e7486;p=pspp-builds.git diff --git a/src/math/categoricals.c b/src/math/categoricals.c index 6002d8c1..33e3b51c 100644 --- a/src/math/categoricals.c +++ b/src/math/categoricals.c @@ -91,11 +91,14 @@ void categoricals_destroy ( struct categoricals *cat) { int i; - for (i = 0 ; i < cat->n_vp; ++i) - hmap_destroy (&cat->vp[i].map); - - pool_destroy (cat->pool); - free (cat); + if (cat != NULL) + { + for (i = 0 ; i < cat->n_vp; ++i) + hmap_destroy (&cat->vp[i].map); + + pool_destroy (cat->pool); + free (cat); + } }