From: Ezra Peisach Date: Mon, 24 May 2004 20:41:23 +0000 (+0000) Subject: krb5_rc_io_open_internal might try to invoke with negative argument X-Git-Tag: krb5-1.4-beta1~403 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=37c7d625e06da8a31090ae58ca745bb74c0133df;p=krb5.git 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 --- 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; }