[libomptarget] Add missing elf_end call in elf_common.c
authorJon Chesterfield <jonathanchesterfield@gmail.com>
Thu, 26 Mar 2020 19:07:31 +0000 (19:07 +0000)
committerJonChesterfield <jonathanchesterfield@gmail.com>
Thu, 26 Mar 2020 19:07:33 +0000 (19:07 +0000)
Summary:
[libomptarget] Add missing elf_end call in elf_common.c
Noticed when reviewing D76843.

Reviewers: simoll, jdoerfert, efocht, AndreyChurbanov, grokos, manorom

Reviewed By: grokos

Subscribers: openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D76874

openmp/libomptarget/plugins/common/elf_common.c

index 60e1e4f..b0efd1a 100644 (file)
@@ -45,6 +45,7 @@ static inline int32_t elf_check_machine(__tgt_device_image *image,
   // Check if ELF is the right kind.
   if (elf_kind(e) != ELF_K_ELF) {
     DP("Unexpected ELF type!\n");
+    elf_end(e);
     return 0;
   }
   Elf64_Ehdr *eh64 = elf64_getehdr(e);