(hx509_lock_free): allow freeing NULL
This commit is contained in:
@@ -214,10 +214,12 @@ hx509_lock_prompt(hx509_lock lock, hx509_prompt *prompt)
|
|||||||
void
|
void
|
||||||
hx509_lock_free(hx509_lock lock)
|
hx509_lock_free(hx509_lock lock)
|
||||||
{
|
{
|
||||||
hx509_certs_free(&lock->certs);
|
if (lock) {
|
||||||
hx509_lock_reset_passwords(lock);
|
hx509_certs_free(&lock->certs);
|
||||||
memset(lock, 0, sizeof(*lock));
|
hx509_lock_reset_passwords(lock);
|
||||||
free(lock);
|
memset(lock, 0, sizeof(*lock));
|
||||||
|
free(lock);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Reference in New Issue
Block a user