summaryrefslogtreecommitdiff
path: root/web/web_misc.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-06-02 02:43:58 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-06-02 02:43:58 -0700
commit823b81363a1145de4b8660153007b11faf4e2c56 (patch)
tree09d9c70e232c1b98ec8447cae6b6618bcd91497d /web/web_misc.c
parent1db534799ef5b41114d80fce0c38f1c93235a8a3 (diff)
downloaddartboat-823b81363a1145de4b8660153007b11faf4e2c56.tar.gz
dartboat-823b81363a1145de4b8660153007b11faf4e2c56.tar.xz
web: fix minor mem leaks and bugs
Diffstat (limited to 'web/web_misc.c')
-rw-r--r--web/web_misc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/web/web_misc.c b/web/web_misc.c
index a754f9e..dcb386e 100644
--- a/web/web_misc.c
+++ b/web/web_misc.c
@@ -27,3 +27,11 @@ char *bufstr_flush(bufstr *b)
b->fl = b->buf;
return b->fl;
}
+
+void bufstr_clear(bufstr *b)
+{
+ if (b->buf != b->fl)
+ free(b->buf);
+ free(b->fl);
+ b->fl = b->buf = NULL;
+}