xkbcomp: plug a potential memory leak
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 18 Mar 2021 02:22:34 +0000 (12:22 +1000)
committerRan Benita <ran@unusedvar.com>
Fri, 19 Mar 2021 21:44:30 +0000 (23:44 +0200)
commit95e29079788a376c4b02d6c7f06ad8b447f3f935
tree0f759210f244e4cfac4ddd89a1323bf613c7a54a
parent01aa2222576c88308d74bbc7f0c459d4acada681
xkbcomp: plug a potential memory leak

libxkbcommon-1.0.3/src/xkbcomp/ast-build.c:526: leaked_storage: Variable "file"
going out of scope leaks the storage it points to.

Where we exit the loop early, we don't release the various allocated memory.

Make this patch more obvious my moving the declaration for those into the loop
as well, this way we know that they aren't used outside the loop anywhere.

Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/xkbcomp/ast-build.c