From d5b6ea2f58132ebbc4d15f700a43328877bd7bba Mon Sep 17 00:00:00 2001 From: Tom Briden Date: Mon, 9 Feb 2026 10:51:36 +0000 Subject: [PATCH] MT#55283 streambuf: check pointer isn't NULL before trying to free it Closes #2065 Change-Id: I091aac6e81dc497668671427267d0ef2321ae8af (cherry picked from commit 4c8e2262bedc021f7968c88d45f8b47e7eb8e6e2) (cherry picked from commit 25734cfc3bc22ec752e0f8c8c165dc603314f8f6) --- lib/streambuf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/streambuf.c b/lib/streambuf.c index c820f7c04..52f4c9e5d 100644 --- a/lib/streambuf.c +++ b/lib/streambuf.c @@ -53,6 +53,8 @@ struct streambuf *streambuf_new(struct poller *p, int fd) { void streambuf_destroy(struct streambuf *b) { + if(!b) + return; g_string_free(b->buf, TRUE); g_free(b); }