cleaning memory after allocation

Signed-off-by: Eyal Salomon <esalomon@mellanox.com>