From: Tobias Brunner Date: Tue, 4 Mar 2025 13:48:42 +0000 (+0100) Subject: pkcs11: Free copied name of PKCS#11 module in error cases X-Git-Tag: 6.0.1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a70ba4d6002c4c2f08d14f9dea983b1f0a8dda17;p=thirdparty%2Fstrongswan.git pkcs11: Free copied name of PKCS#11 module in error cases --- diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_library.c b/src/libstrongswan/plugins/pkcs11/pkcs11_library.c index 95dbd1792c..43da98f4f3 100644 --- a/src/libstrongswan/plugins/pkcs11/pkcs11_library.c +++ b/src/libstrongswan/plugins/pkcs11/pkcs11_library.c @@ -1170,6 +1170,7 @@ pkcs11_library_t *pkcs11_library_create(char *name, char *file, bool os_locking) if (!this->handle) { DBG1(DBG_CFG, "opening PKCS#11 library failed: %s", dlerror()); + free(this->name); free(this); return NULL; } @@ -1177,6 +1178,7 @@ pkcs11_library_t *pkcs11_library_create(char *name, char *file, bool os_locking) if (!initialize(this, name, file, os_locking)) { dlclose(this->handle); + free(this->name); free(this); return NULL; }