The major change are: Fix memleak and invalid memory write issue Signed-off-by: Rosen Penev <rosenp@gmail.com>