In two error cases we return without freeing the bison mood parser
and the temporary array. Worse, in these cases we also expose the
partially loaded mood via the global current_mood.
The good news is that these errors should be "impossible" to trigger
in practice.
if (ret < 0) {
if (errmsg)
*errmsg = make_message("audio file loop failed");
- return ret;
+ goto out;
}
for (i = 0; i < statistics.num; i++) {
struct admissible_file_info *a = aa.array + i;
ret = statistics.num;
out:
free(aa.array);
+ if (ret < 0)
+ close_current_mood();
return ret;
}