Skip to content

Commit ef2f383

Browse files
tombridenrfuchs
authored andcommitted
MT#55283 streambuf: check pointer isn't NULL before trying to free it
Closes #2065 Change-Id: I091aac6e81dc497668671427267d0ef2321ae8af (cherry picked from commit 4c8e226)
1 parent fda8a30 commit ef2f383

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/streambuf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ struct streambuf *streambuf_new(struct poller *p, int fd) {
4949

5050

5151
void streambuf_destroy(struct streambuf *b) {
52+
if(!b)
53+
return;
5254
g_string_free(b->buf, TRUE);
5355
g_slice_free1(sizeof(*b), b);
5456
}

0 commit comments

Comments
 (0)