diff --git a/pack-mtimes.c b/pack-mtimes.c index 0e0aafdcb0..0f9785fc5e 100644 --- a/pack-mtimes.c +++ b/pack-mtimes.c @@ -89,7 +89,8 @@ cleanup: *data_p = data; } - close(fd); + if (fd >= 0) + close(fd); return ret; }