summaryrefslogtreecommitdiff
path: root/tests/Ltest-nocalloc.c
diff options
context:
space:
mode:
authorTommi Rantala <tt.rantala@gmail.com>2012-09-21 09:31:23 +0300
committerTommi Rantala <tt.rantala@gmail.com>2012-09-28 14:51:22 +0300
commit6456da2dc10d13e00b79ac3b366617342d964e5a (patch)
treed19462f49af8307b281099d9c7ab395af1a900df /tests/Ltest-nocalloc.c
parent65f936402d0dd0e62191ed249f86946203476e28 (diff)
downloadlibunwind-6456da2dc10d13e00b79ac3b366617342d964e5a.tar.gz
Assign `func' just once in Ltest-nocalloc glibc case
Diffstat (limited to 'tests/Ltest-nocalloc.c')
-rw-r--r--tests/Ltest-nocalloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/Ltest-nocalloc.c b/tests/Ltest-nocalloc.c
index fb0c9811..f5c31b2a 100644
--- a/tests/Ltest-nocalloc.c
+++ b/tests/Ltest-nocalloc.c
@@ -47,7 +47,8 @@ calloc(size_t n, size_t s)
causes infinite recursion. Instead, we simply use it by its other
name. */
extern void *__libc_calloc(size_t, size_t);
- func = &__libc_calloc;
+ if (!func)
+ func = &__libc_calloc;
#else
if(!func)
func = dlsym(RTLD_NEXT, "calloc");