Skip to content

Commit 66b513b

Browse files
Tom Rixl0kod
authored andcommitted
samples/landlock: Fix path_list memory leak
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 <trix@redhat.com> Link: https://lore.kernel.org/r/20210428213852.2874324-1-trix@redhat.com Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
1 parent dcb85f8 commit 66b513b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)