From 2e0fc40cc49e8168f99b252dba4746c280b7a1d7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 15 Mar 2006 19:26:13 +0000 Subject: [BZ #2451] 2006-03-13 Jakub Jelinek [BZ #2451] * elf/dl-load.c (open_verify): Add free_name argument, if true, free name before calling lose. (open_path): Adjust caller. (_dl_map_object): Adjust callers. Free name_copy before calling _dl_signal_error. * elf/Makefile: Add rules to build and run tst-leaks1. * elf/tst-leaks1.c: New test. --- elf/tst-leaks1.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 elf/tst-leaks1.c (limited to 'elf/tst-leaks1.c') diff --git a/elf/tst-leaks1.c b/elf/tst-leaks1.c new file mode 100644 index 0000000000..c9db5e0537 --- /dev/null +++ b/elf/tst-leaks1.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int +main (void) +{ + mtrace (); + + int ret = 0; + for (int i = 0; i < 10; i++) + { + void *h = dlopen (i < 5 ? "./tst-leaks1.c" + : "$ORIGIN/tst-leaks1.o", RTLD_LAZY); + if (h != NULL) + { + puts ("dlopen unexpectedly succeeded"); + ret = 1; + dlclose (h); + } + } + + return ret; +} -- cgit v1.2.1