aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-02-14 23:13:56 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-02-14 23:13:56 +0000
commitbb57f72d4b985e19dd4d871828cd363b3803c40b (patch)
tree2ef35f99409eb08bc6cc14acd2ab436a02eb80ec
parent2a2a8b42a693be7a7a3f4dc5552406baa598b46a (diff)
parentb6f173c5582a4d8f55b00b17d3cdb91fff809e30 (diff)
downloadselinux-android12L-tests-release.tar.gz
Change-Id: I2110cc40a3d648bb66da62653d6d8a972bf39761
-rw-r--r--libselinux/src/label_backends_android.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
index d81faabe..121b52f5 100644
--- a/libselinux/src/label_backends_android.c
+++ b/libselinux/src/label_backends_android.c
@@ -278,6 +278,12 @@ static void closef(struct selabel_handle *rec)
struct spec *spec;
unsigned int i;
+ if (!data)
+ return;
+
+ /* make sure successive ->func_close() calls are harmless */
+ rec->data = NULL;
+
if (data->spec_arr) {
for (i = 0; i < data->nspec; i++) {
spec = &data->spec_arr[i];