Fix leak on error case

Signed-off-by: Michael Leibowitz <michael.leibowitz@intel.com>