mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-02 23:35:37 +00:00
parser: fix leaking name in variable expansion
Fixes: https://gitlab.com/apparmor/apparmor/-/issues/533 Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
@@ -307,6 +307,7 @@ int variable::expand_variable()
|
||||
}
|
||||
name = variable::process_var(var.c_str());
|
||||
variable *ref = symtab::lookup_existing_symbol(name);
|
||||
free(name);
|
||||
if (!ref) {
|
||||
PERROR("Failed to find declaration for: %s\n", var.c_str());
|
||||
rc = 1;
|
||||
@@ -336,7 +337,6 @@ int variable::expand_variable()
|
||||
}
|
||||
|
||||
out:
|
||||
free(name);
|
||||
expanding = false;
|
||||
return rc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user