From: Alan T. DeKok Date: Tue, 12 Apr 2022 18:38:33 +0000 (-0400) Subject: free handle on error. CID #1469135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d31a648daa608373652ff51b87197a43d9b1f881;p=thirdparty%2Ffreeradius-server.git free handle on error. CID #1469135 --- diff --git a/scripts/build/dlopen.c b/scripts/build/dlopen.c index 3c77cac68c9..efbc47d6cc2 100644 --- a/scripts/build/dlopen.c +++ b/scripts/build/dlopen.c @@ -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; }