]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
free handle on error. CID #1469135
authorAlan T. DeKok <aland@freeradius.org>
Tue, 12 Apr 2022 18:38:33 +0000 (14:38 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 13 Apr 2022 12:55:22 +0000 (08:55 -0400)
scripts/build/dlopen.c

index 3c77cac68c9ef251053fba38094158da92565844..efbc47d6cc26cc01a5c4732bd61753eecc22d804 100644 (file)
@@ -339,6 +339,10 @@ static char *make_dlopen(__attribute__((unused)) char const *nm, unsigned int ar
                        if (name) {
                                FREE(name);
                        }
+
+                       if (handle) {
+                               dlclose(handle);
+                       }
                        return NULL;
                }
 
@@ -390,6 +394,7 @@ static char *make_dlopen(__attribute__((unused)) char const *nm, unsigned int ar
        if (!lib) {
                FREE(libname);
                dlclose(handle);
+               handle = NULL;
                goto oom;
        }