X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdictionary.c;h=f69d91e3605ed246302740c74e1cb2f47ef3d8f7;hb=33e610616a2b48f9a7eb56c4ebb0325b66df0376;hp=43df1eb0e606100df70f98cc89408ab055c39402;hpb=58e33e78895d4f19240b679a8d0656643a482f41;p=pspp diff --git a/src/data/dictionary.c b/src/data/dictionary.c index 43df1eb0e6..f69d91e360 100644 --- a/src/data/dictionary.c +++ b/src/data/dictionary.c @@ -683,7 +683,7 @@ dict_reorder_vars (struct dictionary *d, assert (count == 0 || order != NULL); assert (count <= d->var_cnt); - new_var = xnmalloc (d->var_cnt, sizeof *new_var); + new_var = xnmalloc (d->var_cap, sizeof *new_var); memcpy (new_var, order, count * sizeof *new_var); for (i = 0; i < count; i++) {