DESCRIPTIVES: Avoid use-after-free with TEMPORARY and Z scores.
[pspp] / src / language / stats / median.c
index 2db57ab76f025df50ee42797074981e2e09cfa7e..a894f017a708d8994f1ddd79feee31f573185c00 100644 (file)
@@ -21,7 +21,7 @@
 #include <gsl/gsl_cdf.h>
 
 #include "data/format.h"
-#include "libpspp/cast.h"
+
 
 #include "data/variable.h"
 #include "data/case.h"
 #include "data/casereader.h"
 #include "data/casewriter.h"
 #include "data/subcase.h"
+#include "data/value.h"
 
-
-#include "data/casereader.h"
 #include "math/percentiles.h"
-
 #include "math/sort.h"
 
+#include "libpspp/cast.h"
 #include "libpspp/hmap.h"
 #include "libpspp/array.h"
 #include "libpspp/str.h"
-#include "data/value.h"
 #include "libpspp/misc.h"
 
 #include "output/tab.h"
@@ -199,7 +197,6 @@ median_execute (const struct dataset *ds,
 
          if ( var_is_value_missing (var, case_data (c, var), exclude))
            {
-             case_unref (c);
              continue;
            }
 
@@ -213,7 +210,6 @@ median_execute (const struct dataset *ds,
                  value_compare_3way (indep_val, &nst->val2, width) > 0
                   )
                {
-                 case_unref (c);
                  continue;
                }
            }