mirror of
https://github.com/topjohnwu/selinux.git
synced 2024-12-11 13:26:01 +00:00
libselinux: close the subs file if fstat failed
selabel_subs_init() returned without closing cfg when a call to fstat() failed. Fix this. Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
parent
4a0fab43cb
commit
d819de173d
@ -104,7 +104,7 @@ struct selabel_sub *selabel_subs_init(const char *path,
|
||||
return list;
|
||||
|
||||
if (fstat(fileno(cfg), &sb) < 0)
|
||||
return list;
|
||||
goto out;
|
||||
|
||||
while (fgets_unlocked(buf, sizeof(buf) - 1, cfg)) {
|
||||
char *ptr = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user