Project import generated by Copybara.

GitOrigin-RevId: 47a7f1f46d7b28b0df0186720ef9dc8fbf6e88f3
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 6ff6126..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,27 +0,0 @@
-# Note: use "git ls-files -i --exclude-standard" to make sure
-# no tracked files are ignored as a result of any changes.
-
-# Object files
-*.o
-*.lo
-*.so
-*.so.[0-9]
-*.a
-*.s
-*.mo
-*.pc
-
-# Misc
-*.patch
-*.gz
-*~
-*.orig
-*.rej
-*.pyc
-*.pyo
-cscope.*
-.#*
-\#*
-.*.swp
-# Failsafes
-!.gitignore
diff --git a/libselinux/Android.mk b/libselinux/Android.mk
index 81a742f..52ee483 100644
--- a/libselinux/Android.mk
+++ b/libselinux/Android.mk
@@ -98,9 +98,7 @@
     -Werror \
     -Wno-error=missing-noreturn \
     -Wno-error=unused-function \
-    -Wno-error=unused-variable \
-    -Wno-unused-but-set-variable \
-    -Wno-bitwise-instead-of-logical
+    -Wno-error=unused-variable
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := libselinux
diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
index 68187c9..0b102a1 100644
--- a/libselinux/src/label_file.c
+++ b/libselinux/src/label_file.c
@@ -274,11 +274,12 @@
 		/* store the mapping between old and new */
 		newid = find_stem(data, buf, stem_len);
 		if (newid < 0) {
-			newid = store_stem(data, buf, stem_len, 1);
+			newid = store_stem(data, buf, stem_len);
 			if (newid < 0) {
 				rc = newid;
 				goto out;
 			}
+			data->stem_arr[newid].from_mmap = 1;
 		}
 		stem_map[i] = newid;
 	}
diff --git a/libselinux/src/label_file.h b/libselinux/src/label_file.h
index 245523c..baed334 100644
--- a/libselinux/src/label_file.h
+++ b/libselinux/src/label_file.h
@@ -276,8 +276,7 @@
 }
 
 /* returns the index of the new stored object */
-static inline int store_stem(struct saved_data *data, char *buf, int stem_len,
-	char from_mmap)
+static inline int store_stem(struct saved_data *data, char *buf, int stem_len)
 {
 	int num = data->num_stems;
 
@@ -287,8 +286,7 @@
 		tmp_arr = realloc(data->stem_arr,
 				  sizeof(*tmp_arr) * alloc_stems);
 		if (!tmp_arr) {
-			if (!from_mmap)
-				free(buf);
+			free(buf);
 			return -1;
 		}
 		data->alloc_stems = alloc_stems;
@@ -296,7 +294,7 @@
 	}
 	data->stem_arr[num].len = stem_len;
 	data->stem_arr[num].buf = buf;
-	data->stem_arr[num].from_mmap = from_mmap;
+	data->stem_arr[num].from_mmap = 0;
 	data->num_stems++;
 
 	return num;
@@ -323,7 +321,7 @@
 	if (!stem)
 		return -1;
 
-	return store_stem(data, stem, stem_len, 0);
+	return store_stem(data, stem, stem_len);
 }
 
 /* This will always check for buffer over-runs and either read the next entry
diff --git a/libsepol/Android.mk b/libsepol/Android.mk
index 7389ef1..b491a46 100644
--- a/libsepol/Android.mk
+++ b/libsepol/Android.mk
@@ -8,9 +8,7 @@
     -Wundef \
     -Wshadow \
     -Wno-error=missing-noreturn \
-    -Wmissing-format-attribute \
-    -Wno-unused-but-set-variable \
-    -Wno-bitwise-instead-of-logical
+    -Wmissing-format-attribute
 
 libsepol_src := \
     src/assertion.c \