compiler/libec: Fixed a leak and missing 'return'