mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:13:32 +03:00
nss: use PK11_CreateManagedGenericObject() if available
... so that the memory allocated by applications using libcurl does not grow per each TLS connection. Bug: https://bugzilla.redhat.com/1510247 Closes #2297
This commit is contained in:
parent
b46cfbc068
commit
1605d93a7b
2 changed files with 20 additions and 1 deletions
|
|
@ -440,7 +440,17 @@ static CURLcode nss_create_object(struct ssl_connect_data *connssl,
|
|||
PK11_SETATTRS(attrs, attr_cnt, CKA_TRUST, pval, sizeof(*pval));
|
||||
}
|
||||
|
||||
obj = PK11_CreateGenericObject(slot, attrs, attr_cnt, PR_FALSE);
|
||||
/* PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because
|
||||
* PK11_DestroyGenericObject() does not release resources allocated by
|
||||
* PK11_CreateGenericObject() early enough. */
|
||||
obj =
|
||||
#ifdef HAVE_PK11_CREATEMANAGEDGENERICOBJECT
|
||||
PK11_CreateManagedGenericObject
|
||||
#else
|
||||
PK11_CreateGenericObject
|
||||
#endif
|
||||
(slot, attrs, attr_cnt, PR_FALSE);
|
||||
|
||||
PK11_FreeSlot(slot);
|
||||
if(!obj)
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue