aboutsummaryrefslogtreecommitdiff
path: root/lib/hdb/keytab.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hdb/keytab.c')
-rw-r--r--lib/hdb/keytab.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/hdb/keytab.c b/lib/hdb/keytab.c
index 966c12f89fb0..81cf2b287261 100644
--- a/lib/hdb/keytab.c
+++ b/lib/hdb/keytab.c
@@ -159,8 +159,12 @@ find_db (krb5_context context,
}
}
hdb_free_dbinfo(context, &head);
- if (*dbname == NULL)
- *dbname = strdup(HDB_DEFAULT_DB);
+ if (*dbname == NULL &&
+ (*dbname = strdup(HDB_DEFAULT_DB)) == NULL) {
+ free(*mkey);
+ *mkey = NULL;
+ return krb5_enomem(context);
+ }
return 0;
}