2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 01:57:43 +00:00

parser: free leaking cod_entry in case of failure in do_alias

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
Georgia Garcia 2025-08-04 18:50:54 -03:00
parent 3faddfcf46
commit 8b2e2c3358

View File

@ -133,8 +133,10 @@ static void process_entries(const void *nodep, VISIT value, int level unused)
if (entry->link_name && if (entry->link_name &&
strncmp((*t)->from, entry->link_name, len) == 0) { strncmp((*t)->from, entry->link_name, len) == 0) {
char *n = do_alias(*t, entry->link_name); char *n = do_alias(*t, entry->link_name);
if (!n) if (!n) {
free_cod_entries(dup);
return; return;
}
if (!dup) if (!dup)
dup = copy_cod_entry(entry); dup = copy_cod_entry(entry);
free(dup->link_name); free(dup->link_name);