Address valgrind warnings

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>