summary refs log tree commit diff
path: root/bin/edi
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-11-21 22:40:24 -0500
committerJune McEnroe <june@causal.agency>2018-11-21 22:40:24 -0500
commit58d651706c42778fb5134aed8c9fbc92a77e6ba6 (patch)
tree877d193f8dfbb3d97dc6e65664e6b7a22ba773f0 /bin/edi
parentRead files in edi (diff)
downloadsrc-58d651706c42778fb5134aed8c9fbc92a77e6ba6.tar.gz
src-58d651706c42778fb5134aed8c9fbc92a77e6ba6.zip
Fix freeing empty buffer block
Diffstat (limited to 'bin/edi')
-rw-r--r--bin/edi/buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/edi/buffer.c b/bin/edi/buffer.c
index e15ae20d..7297f411 100644
--- a/bin/edi/buffer.c
+++ b/bin/edi/buffer.c
@@ -75,8 +75,9 @@ void bufferDelete(struct Buffer *buf) {
 wchar_t *bufferDest(struct Buffer *buf, size_t len) {
 	if (buf->len + len > buf->cap) {
 		if (!buf->len) {
+			struct Block *empty = buf->block;
 			buf->block = buf->block->prev;
-			free(buf->block);
+			free(empty);
 		}
 		while (len > buf->cap) buf->cap *= 2;
 		buf->block = blockAlloc(buf->block, buf->cap);
ne McEnroe 2020-11-17Update catgirl to 1.3June McEnroe 2020-11-17Update libretls to 3.2.2June McEnroe 2020-09-29Update libretls to 3.2.1June McEnroe 2020-09-10Update catgirl to 1.2June McEnroe 2020-09-09Add pounce-palaver portJune McEnroe 2020-09-09Update pounce to 2.0June McEnroe 2020-09-09Update litterbox to 1.6June McEnroe 2020-08-23Add scooper portJune McEnroe 2020-08-23Add catsit portJune McEnroe 2020-08-13Update pounce to 1.4p2June McEnroe 2020-08-11Update pounce to 1.4p1June McEnroe 2020-08-10Add litterbox portJune McEnroe 2020-08-10Add missing USES=pkgconfig to pounceJune McEnroe