fix Valgrind issues

Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>