summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 2cb09f5372..e6db6a502c 100644
--- a/string.c
+++ b/string.c
@@ -6287,6 +6287,7 @@ str_undump(VALUE str)
memcpy(buf, encname, size);
buf[size] = '\0';
encidx = rb_enc_find_index(buf);
+ xfree(buf);
if (encidx < 0) {
rb_raise(rb_eRuntimeError, "dumped string has unknown encoding name");
}