]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libelf: Fix elf_end deadlock
authorHeather McIntyre <hsm2@rice.edu>
Tue, 10 Oct 2023 11:16:03 +0000 (13:16 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 14 Oct 2023 14:55:19 +0000 (16:55 +0200)
* libelf/elf_end.c (elf_end): Add rwlock_unlock before
early return.

Signed-off-by: Heather S. McIntyre <hsm2@rice.edu>
Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/elf_end.c

index 89727cb31905eed121ff09b310c560ba9e34bd8d..80f4d13fae8c180ea88f4eb2aae2a9398c258701 100644 (file)
@@ -82,7 +82,10 @@ elf_end (Elf *elf)
       elf->state.ar.ar_sym = NULL;
 
       if (elf->state.ar.children != NULL)
-       return 0;
+       {
+         rwlock_unlock(elf->lock);
+         return 0;
+       }
     }
 
   /* Remove this structure from the children list.  */