34 lines
954 B
Diff
34 lines
954 B
Diff
From 168edd1ca279cc786e0949a9bd43b647c66bd0c8 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
|
|
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 <cgzones@googlemail.com>
|
|
Acked-by: James Carter <jwcart2@gmail.com>
|
|
---
|
|
libselinux/src/label_file.h | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/src/label_file.h b/src/label_file.h
|
|
index 1363c83c..ea02cd5e 100644
|
|
--- a/src/label_file.h
|
|
+++ b/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);
|
|
errno = rc;
|
|
return -1;
|
|
}
|
|
--
|
|
2.27.0
|
|
|