=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ctfconv/ctfconv.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/usr.bin/ctfconv/ctfconv.c 2017/08/29 21:10:20 1.8 +++ src/usr.bin/ctfconv/ctfconv.c 2017/09/19 08:28:57 1.9 @@ -1,4 +1,4 @@ -/* $OpenBSD: ctfconv.c,v 1.8 2017/08/29 21:10:20 deraadt Exp $ */ +/* $OpenBSD: ctfconv.c,v 1.9 2017/09/19 08:28:57 jsg Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -180,10 +180,12 @@ } if (fstat(fd, &st) == -1) { warn("fstat %s", path); + close(fd); return 1; } if ((uintmax_t)st.st_size > SIZE_MAX) { warnx("file too big to fit memory"); + close(fd); return 1; }