hdb: Fix warnings and leaks

This commit is contained in:
Nicolas Williams
2021-03-28 17:55:14 -05:00
parent fb553dde1d
commit 4f8399a433
9 changed files with 44 additions and 30 deletions

View File

@@ -160,8 +160,11 @@ find_db (krb5_context context,
}
hdb_free_dbinfo(context, &head);
if (*dbname == NULL &&
(*dbname = strdup(hdb_default_db(context))) == NULL)
(*dbname = strdup(hdb_default_db(context))) == NULL) {
free(*mkey);
*mkey = NULL;
return krb5_enomem(context);
}
return 0;
}