From 168edd1ca279cc786e0949a9bd43b647c66bd0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 14 Aug 2023 14:08:55 +0200 Subject: [PATCH] libselinux: free elements on read_spec_entries() failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some entries might have been already parsed and allocated. Signed-off-by: Christian Göttsche Acked-by: James Carter --- libselinux/src/label_file.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libselinux/src/label_file.h b/libselinux/src/label_file.h index 1363c83c..ea02cd5e 100644 --- a/libselinux/src/label_file.h +++ b/libselinux/src/label_file.h @@ -446,6 +446,9 @@ static inline int process_line(struct selabel_handle *rec, "%s: line %u error due to: %m\n", path, lineno); } + free(regex); + free(type); + free(context); return -1; }