diff options
-rw-r--r-- | buf.c | 2 | ||||
-rw-r--r-- | buf.h | 1 | ||||
-rw-r--r-- | chksum.c | 2 |
3 files changed, 3 insertions, 2 deletions
@@ -130,7 +130,7 @@ val make_duplicate_buf(val len, mem_t *data) return obj; } -static val make_owned_buf(val len, mem_t *data) +val make_owned_buf(val len, mem_t *data) { val buf = make_borrowed_buf(len, data); buf->b.size = len; @@ -29,6 +29,7 @@ val make_buf(val len, val init_val, val alloc_size); val bufp(val object); val make_borrowed_buf(val len, mem_t *data); val init_borrowed_buf(obj_t *buf, val len, mem_t *data); +val make_owned_buf(val len, mem_t *data); val make_duplicate_buf(val len, mem_t *data); val copy_buf(val buf); val buf_trim(val buf); @@ -97,7 +97,7 @@ static val chksum_ensure_buf(val self, val buf_in, { if (null_or_missing_p(buf_in)) { *phash = chk_malloc(c_unum(len, self)); - return make_borrowed_buf(len, *phash); + return make_owned_buf(len, *phash); } else { *phash = buf_get(buf_in, self); if (lt(length_buf(buf_in), len)) |