Snap for 8164116 from 6d35bdeedae09728adc6a2479fdece7f4b4878dd to mainline-resolv-release

Change-Id: I035c4442d3a1c1b107c335976c6d61ae23ed8bc5
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
index d81faab..121b52f 100644
--- a/libselinux/src/label_backends_android.c
+++ b/libselinux/src/label_backends_android.c
@@ -278,6 +278,12 @@
 	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];