pkcs11: Free copied name of PKCS#11 module in error cases
This commit is contained in:
@@ -1170,6 +1170,7 @@ pkcs11_library_t *pkcs11_library_create(char *name, char *file, bool os_locking)
|
|||||||
if (!this->handle)
|
if (!this->handle)
|
||||||
{
|
{
|
||||||
DBG1(DBG_CFG, "opening PKCS#11 library failed: %s", dlerror());
|
DBG1(DBG_CFG, "opening PKCS#11 library failed: %s", dlerror());
|
||||||
|
free(this->name);
|
||||||
free(this);
|
free(this);
|
||||||
return NULL;
|
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))
|
if (!initialize(this, name, file, os_locking))
|
||||||
{
|
{
|
||||||
dlclose(this->handle);
|
dlclose(this->handle);
|
||||||
|
free(this->name);
|
||||||
free(this);
|
free(this);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user