projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ef8332f
)
FREQUENCIES: Fix memory leak with percentiles and split file.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sat, 6 Aug 2022 17:11:59 +0000
(10:11 -0700)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sat, 6 Aug 2022 17:11:59 +0000
(10:11 -0700)
src/language/stats/frequencies.c
patch
|
blob
|
history
diff --git
a/src/language/stats/frequencies.c
b/src/language/stats/frequencies.c
index a851c2196073a4ba1d3b530f70c686aca323e19f..3f7afaa361801e468879dd5e246ce4a6d6bb9c80 100644
(file)
--- a/
src/language/stats/frequencies.c
+++ b/
src/language/stats/frequencies.c
@@
-359,7
+359,8
@@
calc_percentiles (const struct frq_proc *frq, struct var_freqs *vf)
if (!frq->n_percentiles)
return;
if (!frq->n_percentiles)
return;
- vf->percentiles = xnmalloc (frq->n_percentiles, sizeof *vf->percentiles);
+ if (!vf->percentiles)
+ vf->percentiles = xnmalloc (frq->n_percentiles, sizeof *vf->percentiles);
const struct freq_tab *ft = &vf->tab;
const double W = ft->valid_cases;
const struct freq_tab *ft = &vf->tab;
const double W = ft->valid_cases;