]> git.tue.mpg.de Git - paraslash.git/commit
mood.c: Fix memory leak in error path of load_mood().
authorAndre Noll <maan@tuebingen.mpg.de>
Thu, 10 Mar 2022 20:32:22 +0000 (21:32 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 12 Mar 2022 16:06:51 +0000 (17:06 +0100)
commitc88ccb7d91ea4baab78e24922d5c1d0cbaf6dcce
tree4d1c0a9a5f1c080f542451700bffb435bb849981
parent46b9e018548fa7baebe62b6c724d215c84dcb20f
mood.c: Fix memory leak in error path of load_mood().

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
mood.c