Skip to content

Commit

Permalink
samples/landlock: Fix path_list memory leak
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Tom Rix authored and l0kod committed Feb 4, 2022
1 parent dcb85f8 commit 66b513b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions samples/landlock/sandboxer.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ static int populate_ruleset(
ret = 0;

out_free_name:
free(path_list);
free(env_path_name);
return ret;
}
Expand Down

0 comments on commit 66b513b

Please sign in to comment.