Merge "Enable .debug_frame support on all platforms."
diff --git a/src/os-linux.c b/src/os-linux.c
index cebe5aa..0265a16 100644
--- a/src/os-linux.c
+++ b/src/os-linux.c
@@ -73,11 +73,13 @@
       if ((flags & (PROT_EXEC | PROT_READ)) == (PROT_EXEC | PROT_READ)
           && !(cur_map->flags & MAP_FLAGS_DEVICE_MEM))
         {
-          if (elf_map_image (&cur_map->ei, cur_map->path))
+          struct elf_image ei;
+          if (elf_map_image (&ei, cur_map->path))
             {
               unw_word_t load_base;
-              if (elf_w (get_load_base) (&cur_map->ei, offset, &load_base))
+              if (elf_w (get_load_base) (&ei, offset, &load_base))
                 cur_map->load_base = load_base;
+              munmap (ei.u.mapped.image, ei.u.mapped.size);
             }
         }