From 37c7d625e06da8a31090ae58ca745bb74c0133df Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 24 May 2004 20:41:23 +0000 Subject: [PATCH] krb5_rc_io_open_internal might try to invoke with negative argument * rc_io.c (krb5_rc_io_open_internal): If file could not be open, do not invoke close negative argument. Ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16357 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/rcache/ChangeLog | 5 +++++ src/lib/krb5/rcache/rc_io.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/rcache/ChangeLog b/src/lib/krb5/rcache/ChangeLog index f59de203e..b2c49135c 100644 --- a/src/lib/krb5/rcache/ChangeLog +++ b/src/lib/krb5/rcache/ChangeLog @@ -1,3 +1,8 @@ +2004-05-24 Ezra Peisach + + * rc_io.c (krb5_rc_io_open_internal): If file could not be open, + do not invoke close negative argument. + 2004-05-03 Kenneth Raeburn * rc_dfl.c (krb5_rc_dfl_expunge_locked): Declare before use. diff --git a/src/lib/krb5/rcache/rc_io.c b/src/lib/krb5/rcache/rc_io.c index 4b32cc816..706bd759a 100644 --- a/src/lib/krb5/rcache/rc_io.c +++ b/src/lib/krb5/rcache/rc_io.c @@ -256,7 +256,8 @@ krb5_rc_io_open_internal(krb5_context context, krb5_rc_iostuff *d, char *fn, FREE(d->fn); d->fn = NULL; } - (void) close(d->fd); + if (d->fd >= 0) + (void) close(d->fd); } return retval; } -- 2.26.2