From deefdd2f9d01195999c528c9eba1a70f7a7cf489 Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Sun, 12 Nov 2017 17:23:54 +0800 Subject: [PATCH] Fix bug: double free Signed-off-by: Jianhui Zhao --- src/uhttp_buf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/uhttp_buf.c b/src/uhttp_buf.c index 5c5af83..e7332bd 100755 --- a/src/uhttp_buf.c +++ b/src/uhttp_buf.c @@ -34,10 +34,7 @@ int uh_buf_grow(struct uh_buf *buf, size_t size) void uh_buf_free(struct uh_buf *buf) { - if (buf->base) { - free(buf->base); - uh_buf_init(buf, 0); - } + uh_buf_init(buf, 0); } size_t uh_buf_append(struct uh_buf *buf, const void *data, size_t len)