Skip to content

Commit 2fb85ca

Browse files
Tom Rixsmb49
authored andcommitted
samples/landlock: Fix path_list memory leak
BugLink: https://bugs.launchpad.net/bugs/1969110 commit 66b513b upstream. Clang static analysis reports this error sandboxer.c:134:8: warning: Potential leak of memory pointed to by 'path_list' ret = 0; ^ path_list is allocated in parse_path() but never freed. Signed-off-by: Tom Rix <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Signed-off-by: Mickaël Salaün <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 20fbf100f84b9aeb9c91421abe1927bc152bc32b) Signed-off-by: Paolo Pisati <[email protected]>
1 parent a67e739 commit 2fb85ca

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

samples/landlock/sandboxer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ static int populate_ruleset(
134134
ret = 0;
135135

136136
out_free_name:
137+
free(path_list);
137138
free(env_path_name);
138139
return ret;
139140
}

0 commit comments

Comments
 (0)