diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-04-12 23:28:55 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-04-12 23:28:55 +0300 |
commit | 9fff07da8c25183f53934c0155d1fa49bc97198e (patch) | |
tree | a86746916709bd35fbd538457c5ea2447675fee6 | |
parent | 92f4d54776e4183a81209a9ce3a28f052f9249e4 (diff) | |
download | egawk-9fff07da8c25183f53934c0155d1fa49bc97198e.tar.gz egawk-9fff07da8c25183f53934c0155d1fa49bc97198e.tar.bz2 egawk-9fff07da8c25183f53934c0155d1fa49bc97198e.zip |
Fix a memory leak in mpfr formatting values.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | mpfr.c | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2017-04-12 Arnold D. Robbins <arnold@skeeve.com> + + * mpfr.c (mpg_format_val): Set STRCUR flag when we're done. + Fixes a memory leak. Thanks to valgrind for the report. + 2017-04-12 Manuel Collado <m-collado@users.sourceforge.net> Fix the FPAT bug reported by Ed Morton in the gawk-bug mailing list. @@ -384,6 +384,7 @@ mpg_format_val(const char *format, int index, NODE *s) if ((s->flags & (MALLOC|STRCUR)) == (MALLOC|STRCUR)) efree(s->stptr); s->stptr = r->stptr; + s->flags |= STRCUR; freenode(r); /* Do not unref(r)! We want to keep s->stptr == r->stpr. */ free_wstr(s); return s; |