summaryrefslogtreecommitdiff
path: root/src/bin/sb.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-09-04 00:28:21 +0200
committerBoris Faure <billiob@gmail.com>2019-09-04 00:28:21 +0200
commitf01c312f015d5744fbe546ea7601f0f1de93d40b (patch)
tree3c78f9deafa4b10eaa711419a1988501ce7b6af3 /src/bin/sb.c
parent421e40dbfc690ecb5985df74fa0ab44ae7d3fc1b (diff)
fix leaks when looking for links
Diffstat (limited to 'src/bin/sb.c')
-rw-r--r--src/bin/sb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/sb.c b/src/bin/sb.c
index b2bffa5..a0dd9e8 100644
--- a/src/bin/sb.c
+++ b/src/bin/sb.c
@@ -43,6 +43,7 @@ ty_sb_prepend(struct ty_sb *sb, const char *s, size_t len)
43 return -1; 43 return -1;
44 44
45 memcpy(new_buf + new_gap, sb->buf, sb->len); 45 memcpy(new_buf + new_gap, sb->buf, sb->len);
46 free(sb->buf - sb->gap);
46 sb->buf = new_buf + new_gap; 47 sb->buf = new_buf + new_gap;
47 sb->gap = new_gap; 48 sb->gap = new_gap;
48 sb->alloc = new_alloc; 49 sb->alloc = new_alloc;