When an existing mood definition happens to be invalid so that
mp_init() fails, we return negative and leak the mood structure
just allocated.
This bug was introduced by the commit which removed version 1 moods.
It was found by code inspection.
Fixes: 184ea897a9b4
PARA_INFO_LOG("opening mood %s\n", mood_name);
ret = mp_init(mood_def.data, mood_def.size, &(*m)->parser_context, errmsg);
osl_close_disk_object(&mood_def);
+ if (ret < 0)
+ destroy_mood(*m);
return ret;
}