diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-04-30 22:14:54 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-04-30 22:14:54 -0700 |
commit | 6285d863a17dbf5afac81c9b5c8df0947210782a (patch) | |
tree | cb34c92dec351d20f5c2d9589c92066f82eea093 /buf.c | |
parent | 899a209f71111857b39a2eacb46bcb2484130133 (diff) | |
download | txr-6285d863a17dbf5afac81c9b5c8df0947210782a.tar.gz txr-6285d863a17dbf5afac81c9b5c8df0947210782a.tar.bz2 txr-6285d863a17dbf5afac81c9b5c8df0947210782a.zip |
buf: fix memory leak.
* buf.c (make_duplicate_buf): A duplicated buf is dynamic,
so the size must not be nil, which indicates a static or
borrowed one. Set the size properly, so finalize will free it.
Diffstat (limited to 'buf.c')
-rw-r--r-- | buf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -114,7 +114,7 @@ val make_duplicate_buf(val len, mem_t *data) obj->b.type = BUF; obj->b.data = chk_copy_obj(data, c_num(len)); obj->b.len = len; - obj->b.size = nil; + obj->b.size = len; return obj; } |