(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
|
||||
hx509_lock_free(hx509_lock lock)
|
||||
{
|
||||
hx509_certs_free(&lock->certs);
|
||||
hx509_lock_reset_passwords(lock);
|
||||
memset(lock, 0, sizeof(*lock));
|
||||
free(lock);
|
||||
if (lock) {
|
||||
hx509_certs_free(&lock->certs);
|
||||
hx509_lock_reset_passwords(lock);
|
||||
memset(lock, 0, sizeof(*lock));
|
||||
free(lock);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
Reference in New Issue
Block a user