Correctly handle the case of empty LD_PRELOAD entries
am: bda20e78f0

* commit 'bda20e78f0f314dbbf0f0bbcf0740cf2d6a4b85e':
  Correctly handle the case of empty LD_PRELOAD entries

Change-Id: I8278e77864b0b85af94e527ec0d34eba052ec13a
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 9836210..39aa2ca 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -543,6 +543,9 @@
   if (path != nullptr) {
     // We have historically supported ':' as well as ' ' in LD_PRELOAD.
     g_ld_preload_names = android::base::Split(path, " :");
+    std::remove_if(g_ld_preload_names.begin(),
+                   g_ld_preload_names.end(),
+                   [] (const std::string& s) { return s.empty(); });
   }
 }