Skip to content

Commit 4c8e226

Browse files
tombridenrfuchs
authored andcommitted
MT#55283 streambuf: check pointer isn't NULL before trying to free it
Closes #2065 Change-Id: I091aac6e81dc497668671427267d0ef2321ae8af
1 parent 1542f8f commit 4c8e226

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
@@ -53,6 +53,8 @@ struct streambuf *streambuf_new(struct poller *p, int fd) {
5353

5454

5555
void streambuf_destroy(struct streambuf *b) {
56+
if(!b)
57+
return;
5658
g_string_free(b->buf, TRUE);
5759
g_free(b);
5860
}

0 commit comments

Comments
 (0)