fix memory leak when compressed packet is not valid