summaryrefslogtreecommitdiff
path: root/mpfr.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2017-04-12 23:28:55 +0300
committerArnold D. Robbins <arnold@skeeve.com>2017-04-12 23:28:55 +0300
commit9fff07da8c25183f53934c0155d1fa49bc97198e (patch)
treea86746916709bd35fbd538457c5ea2447675fee6 /mpfr.c
parent92f4d54776e4183a81209a9ce3a28f052f9249e4 (diff)
downloadgawk-9fff07da8c25183f53934c0155d1fa49bc97198e.tar.gz
Fix a memory leak in mpfr formatting values.
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mpfr.c b/mpfr.c
index ec8d5561..5a2a35d3 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -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;