Memleak fix.

Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>