aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2025-07-12 12:47:01 -0400
committerEugene Triguba <eugenetriguba@gmail.com>2025-07-12 12:47:01 -0400
commit814e86e74f2603a34b6576ab335ad9ac70ade763 (patch)
tree0004c93e1d5248ab009693239c24edf39e94a41d /src
parentAdd test for clear to linebuffer tests (diff)
downloadcli-814e86e74f2603a34b6576ab335ad9ac70ade763.zip
Add linebuffer destroy to error case
Diffstat (limited to 'src')
-rw-r--r--src/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index ee5cdd7..bc7b70a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,6 +59,7 @@ int justify(size_t linebuffer_capacity, FILE *in, FILE *out) {
}
if (read_word_result == READ_WORD_ERR_READ) {
fprintf(stderr, "Error reading word\n");
+ linebuffer_destroy(lb);
return EXIT_FAILURE;
}
if (linebuffer_space_remaining(lb) < linebuffer_capacity) {