libselinux/backport-libselinux-free-elements-on-read_spec_entries-failur.patch
fly_fzc 1adbdc5f45 backport upstream patches
(cherry picked from commit 0327677f388cddd541515ad3c502b705258fbffc)
2023-12-07 09:35:09 +08:00

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