mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
2e0fc40cc4
2006-03-13 Jakub Jelinek <jakub@redhat.com> [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.
25 lines
361 B
C
25 lines
361 B
C
#include <dlfcn.h>
|
|
#include <mcheck.h>
|
|
#include <stdlib.h>
|
|
|
|
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;
|
|
}
|