]> git.cworth.org Git - fips/commitdiff
dlwrap: Fix dlwrap_real_dlopen to only perform dlsym-lookup once
authorCarl Worth <cworth@cworth.org>
Thu, 30 May 2013 19:55:26 +0000 (12:55 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 30 May 2013 20:09:58 +0000 (13:09 -0700)
Making the real_dlopen variable static means that we perform the dlysm
lookup only once and then re-use the result for later calls. This is
what was always intended for this code.

dlwrap.c

index 0c57f752bdf039ac2f3e15b22e62e595884f887e..aac06f6eda22a663643bd49a0397a4700862a993 100644 (file)
--- a/dlwrap.c
+++ b/dlwrap.c
@@ -62,7 +62,7 @@ dlopen (const char *filename, int flag)
 void *
 dlwrap_real_dlopen (const char *filename, int flag)
 {
-       fips_dlopen_t real_dlopen = NULL;
+       static fips_dlopen_t real_dlopen = NULL;
 
        if (! real_dlopen) {
                real_dlopen = (fips_dlopen_t) dlwrap_real_dlsym (RTLD_NEXT, "dlopen");