This variable may be leaked in some error paths. Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx> --- libselinux/src/label_db.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libselinux/src/label_db.c b/libselinux/src/label_db.c index 1155bcc84031..c46d0a1de9a7 100644 --- a/libselinux/src/label_db.c +++ b/libselinux/src/label_db.c @@ -281,9 +281,12 @@ db_init(const struct selinux_opt *opts, unsigned nopts, free(catalog); return NULL; } - if (fstat(fileno(filp), &sb) < 0) + if (fstat(fileno(filp), &sb) < 0) { + free(catalog); return NULL; + } if (!S_ISREG(sb.st_mode)) { + free(catalog); errno = EINVAL; return NULL; } -- 2.11.0 _______________________________________________ Selinux mailing list Selinux@xxxxxxxxxxxxx To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx. To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.