Message ID | 20231109135315.44095-3-cgzones@googlemail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | d858afcaac2a |
Delegated to: | Petr Lautrbach |
Headers | show |
Series | [1/5] semodule_link: avoid NULL dereference on OOM | expand |
diff --git a/libselinux/src/is_customizable_type.c b/libselinux/src/is_customizable_type.c index 9be50174..da301c60 100644 --- a/libselinux/src/is_customizable_type.c +++ b/libselinux/src/is_customizable_type.c @@ -33,6 +33,7 @@ static void customizable_init(void) } if (fseek(fp, 0L, SEEK_SET) == -1) { + free(buf); fclose(fp); return; }
Reported by Clang Analyzer: is_customizable_type.c:36:3: warning: Potential leak of memory pointed to by 'buf' [unix.Malloc] 36 | fclose(fp); | ^~~~~~ Fixes: 9911f2ac6f77 ("libselinux: check for stream rewind failures") Signed-off-by: Christian Göttsche <cgzones@googlemail.com> --- libselinux/src/is_customizable_type.c | 1 + 1 file changed, 1 insertion(+)