mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
binutils: fix resource leak on aa-load
Dir "d" is not closed when asprintf fails. Found by coverity: CID 321416: Resource leaks (RESOURCE_LEAK) Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
parent
ab218526bf
commit
b0902a34d1
1 changed files with 1 additions and 0 deletions
|
@ -179,6 +179,7 @@ static int load_policy_dir(const char *dir_path)
|
|||
}
|
||||
if (asprintf(&file, "%s/%s", dir_path, dir->d_name) == -1) {
|
||||
error("Failure allocating memory");
|
||||
closedir(d);
|
||||
return -1;
|
||||
}
|
||||
load_policy_file(file);
|
||||
|
|
Loading…
Add table
Reference in a new issue