Skip to content

Commit

Permalink
wio: Fix memory clearing which resets refcounter
Browse files Browse the repository at this point in the history
The w_io_init() function performs a memset() which clears the entire
object, including the w_obj_t fields, which resets the reference counter
unconditionally. This patch makes sure that w__obj_init() is called on
the object.
  • Loading branch information
aperezdc committed Aug 4, 2015
1 parent 8c4a042 commit 2f04bee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wio.c
Expand Up @@ -313,6 +313,7 @@ w_io_init (w_io_t *io)
w_assert (io);

memset (io, 0x00, sizeof (w_io_t));
w__obj_init ((w_obj_t*) io);
io->backch = W_IO_EOF;
w_obj_dtor (io, w_io_cleanup);
}
Expand Down

0 comments on commit 2f04bee

Please sign in to comment.