Prevent possible resource leak.

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>