(hx509_lock_free): allow freeing NULL

This commit is contained in:
Love Hornquist Astrand
2009-09-29 11:12:32 -07:00
parent a610d28727
commit 50de7c4203

View File

@@ -214,11 +214,13 @@ hx509_lock_prompt(hx509_lock lock, hx509_prompt *prompt)
void
hx509_lock_free(hx509_lock lock)
{
if (lock) {
hx509_certs_free(&lock->certs);
hx509_lock_reset_passwords(lock);
memset(lock, 0, sizeof(*lock));
free(lock);
}
}
int
hx509_prompt_hidden(hx509_prompt_type type)