mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 01:57:43 +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:
parent
8b2e2c3358
commit
b8dee97ed3
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user