krb5: Fix NULL deref on ENOMEM in fkt_add_entry()
This commit is contained in:
@@ -561,6 +561,10 @@ fkt_add_entry(krb5_context context,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
sp = krb5_storage_stdio_from_fd(fd, "wb+");
|
sp = krb5_storage_stdio_from_fd(fd, "wb+");
|
||||||
|
if (sp == NULL) {
|
||||||
|
close(fd);
|
||||||
|
return krb5_enomem(context);
|
||||||
|
}
|
||||||
krb5_storage_set_eof_code(sp, KRB5_KT_END);
|
krb5_storage_set_eof_code(sp, KRB5_KT_END);
|
||||||
ret = fkt_setup_keytab(context, id, sp);
|
ret = fkt_setup_keytab(context, id, sp);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
Reference in New Issue
Block a user