From: Tom Yu Date: Mon, 18 Dec 2006 23:11:28 +0000 (+0000) Subject: pull up r18961 from trunk X-Git-Tag: krb5-1.6-beta2~17 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2507ca66fb6b3f96f5e13968f309e2f8146ebd88;p=krb5.git pull up r18961 from trunk r18961@cathode-dark-space: epeisach | 2006-12-18 06:26:59 -0500 ticket: new subject: krb5_rc_io_open_internal on error will call close(-1) If there is an error in opening the replay cache - memory is freed, but close() is invoked with -1 (failure from open()). While technically, close() will return EBADF in such a case, and nothing bad will happen, valgrind picks up on this and provides an error... ticket: 5115 version_fixed: 1.6 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@18966 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/rcache/rc_io.c b/src/lib/krb5/rcache/rc_io.c index 8453d1832..adc6a8c49 100644 --- a/src/lib/krb5/rcache/rc_io.c +++ b/src/lib/krb5/rcache/rc_io.c @@ -168,7 +168,9 @@ krb5_rc_io_creat(krb5_context context, krb5_rc_iostuff *d, char **fn) FREE(d->fn); d->fn = NULL; } - (void) close(d->fd); + if (d->fd != -1) { + (void) close(d->fd); + } } return retval; }