rules: simplify an error path

Initialize to NULL so we don't have to care about whether the cleanups can be
called or not.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
master
Peter Hutterer 2019-11-12 15:25:16 +10:00 committed by Ran Benita
parent d9b9885624
commit bb7551a649
1 changed files with 3 additions and 3 deletions

View File

@ -1034,8 +1034,8 @@ xkb_components_from_rules(struct xkb_context *ctx,
{
bool ret = false;
FILE *file;
char *path;
struct matcher *matcher;
char *path = NULL;
struct matcher *matcher = NULL;
file = FindFileInXkbPath(ctx, rmlvo->rules, FILE_TYPE_RULES, &path);
if (!file)
@ -1050,8 +1050,8 @@ xkb_components_from_rules(struct xkb_context *ctx,
if (!ret)
log_err(ctx, "No components returned from XKB rules \"%s\"\n", path);
err_out:
matcher_free(matcher);
free(path);
err_out:
return ret;
}