krb5_rc_io_open_internal might try to invoke with negative argument
authorEzra Peisach <epeisach@mit.edu>
Mon, 24 May 2004 20:41:23 +0000 (20:41 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 24 May 2004 20:41:23 +0000 (20:41 +0000)
* 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
src/lib/krb5/rcache/rc_io.c

index f59de203e1fd5f94f19dd0750cdf89183b159396..b2c49135c6d5926d5adc415099e1b9da0512752f 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-24  Ezra Peisach  <epeisach@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * rc_dfl.c (krb5_rc_dfl_expunge_locked): Declare before use.
index 4b32cc8166d9d0cb4c6c0660fc03222b8cd6fa1b..706bd759a677bdf127172e9efda852df4b0cf951 100644 (file)
@@ -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;
 }