Fix #1514 - explicitely initialize io in mg_iobuf_init()

This commit is contained in:
Sergey Lyubka 2022-04-12 09:53:42 +01:00
parent e5d1b213c9
commit 85281ae128
2 changed files with 4 additions and 0 deletions

View File

@ -1998,6 +1998,8 @@ int mg_iobuf_resize(struct mg_iobuf *io, size_t new_size) {
}
int mg_iobuf_init(struct mg_iobuf *io, size_t size) {
io->buf = NULL;
io->size = io->len = 0;
return mg_iobuf_resize(io, size);
}

View File

@ -38,6 +38,8 @@ int mg_iobuf_resize(struct mg_iobuf *io, size_t new_size) {
}
int mg_iobuf_init(struct mg_iobuf *io, size_t size) {
io->buf = NULL;
io->size = io->len = 0;
return mg_iobuf_resize(io, size);
}