(krb5_storage_from_fd): check malloc returns

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10190 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-06-24 05:39:51 +00:00
parent 99e55f95aa
commit b2848e8199

View File

@@ -63,7 +63,15 @@ krb5_storage *
krb5_storage_from_fd(int fd)
{
krb5_storage *sp = malloc(sizeof(krb5_storage));
if (sp == NULL)
return NULL;
sp->data = malloc(sizeof(fd_storage));
if (sp->data == NULL) {
free(sp);
return NULL;
}
sp->flags = 0;
FD(sp) = fd;
sp->fetch = fd_fetch;