diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-03-18 11:22:38 +1000 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2021-03-19 23:44:30 +0200 |
commit | 01aa2222576c88308d74bbc7f0c459d4acada681 (patch) | |
tree | 50308644d9dbd40ab4b3a1a9a7037b3df232822c /src | |
parent | 694b8f7127aa01e9c06076e16731ca10249cf8c0 (diff) | |
download | libxkbcommon-01aa2222576c88308d74bbc7f0c459d4acada681.tar.gz libxkbcommon-01aa2222576c88308d74bbc7f0c459d4acada681.tar.bz2 libxkbcommon-01aa2222576c88308d74bbc7f0c459d4acada681.zip |
registry: plug a potential memleak for invalid rules files
If the name is missing in a configItem, we'd fail and leak the memory for
description, brief and vendor.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/registry.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/registry.c b/src/registry.c index dcaaa1b..7198828 100644 --- a/src/registry.c +++ b/src/registry.c @@ -742,6 +742,10 @@ parse_config_item(struct rxkb_context *ctx, if (!*name || !strlen(*name)) { log_err(ctx, "xml:%d: missing required element 'name'\n", ci->line); + free(*name); + free(*description); + free(*brief); + free(*vendor); return false; } |