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>master
parent
694b8f7127
commit
01aa222257
|
@ -742,6 +742,10 @@ parse_config_item(struct rxkb_context *ctx,
|
||||||
if (!*name || !strlen(*name)) {
|
if (!*name || !strlen(*name)) {
|
||||||
log_err(ctx, "xml:%d: missing required element 'name'\n",
|
log_err(ctx, "xml:%d: missing required element 'name'\n",
|
||||||
ci->line);
|
ci->line);
|
||||||
|
free(*name);
|
||||||
|
free(*description);
|
||||||
|
free(*brief);
|
||||||
|
free(*vendor);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue