summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5/keytab_file.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-08-09 03:04:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:33 -0500
commitc0e8144c5d1e402b36ebe04b843eba62e7ab9958 (patch)
tree1b885ceee1a88e8cb2822051690b023c8f8acb78 /source4/heimdal/lib/krb5/keytab_file.c
parent4b93e377cd9809199487e20fa53d8a2c98ad32ea (diff)
downloadsamba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.tar.gz
samba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.tar.bz2
samba-c0e8144c5d1e402b36ebe04b843eba62e7ab9958.zip
r9221: Try to merge Heimdal across from lorikeet-heimdal to samba4.
This is my first attempt at this, so there may be a few rough edges. Andrew Bartlett (This used to be commit 9a1d2f2fec67930975da856a2d365345cec46216)
Diffstat (limited to 'source4/heimdal/lib/krb5/keytab_file.c')
-rw-r--r--source4/heimdal/lib/krb5/keytab_file.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/heimdal/lib/krb5/keytab_file.c b/source4/heimdal/lib/krb5/keytab_file.c
index dca09ff6f3..6ff2680ed1 100644
--- a/source4/heimdal/lib/krb5/keytab_file.c
+++ b/source4/heimdal/lib/krb5/keytab_file.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997 - 2005 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -33,7 +33,7 @@
#include "krb5_locl.h"
-RCSID("$Id: keytab_file.c,v 1.18 2005/05/31 21:50:43 lha Exp $");
+RCSID("$Id: keytab_file.c,v 1.20 2005/07/13 06:08:07 lha Exp $");
#define KRB5_KT_VNO_1 1
#define KRB5_KT_VNO_2 2
@@ -332,6 +332,12 @@ fkt_start_seq_get_int(krb5_context context,
return ret;
}
c->sp = krb5_storage_from_fd(c->fd);
+ if (c->sp == NULL) {
+ _krb5_xunlock(context, c->fd);
+ close(c->fd);
+ krb5_set_error_string (context, "malloc: out of memory");
+ return ENOMEM;
+ }
krb5_storage_set_eof_code(c->sp, KRB5_KT_END);
ret = krb5_ret_int8(c->sp, &pvno);
if(ret) {