liblog: android_closeEventTagMap pointer check
Followup to c/278768 where failure to open tag map can
result in segment violation in android_closeEventTagMap.
Add check for pointer value = -1 to bypass call to close.
Test: gTest liblog-unit-tests, logcat-unit-tests & logd-unit-tests
Bug: 30963384
Bug: 31456426
Change-Id: I20547e55d7e29682fde4538bc1fc6d83b4535d49
diff --git a/liblog/logger_write.c b/liblog/logger_write.c
index c481e36..157bd88 100644
--- a/liblog/logger_write.c
+++ b/liblog/logger_write.c
@@ -189,7 +189,7 @@
__android_log_unlock();
#if defined(__BIONIC__)
- android_closeEventTagMap(m);
+ if (m != (EventTagMap *)(uintptr_t)-1LL) android_closeEventTagMap(m);
#endif
}