Fix some leaks

Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>