2013-09-26 17:14:40 +02:00

17 lines
395 B
Plaintext

$NetBSD: patch-ac,v 1.2 2011/07/08 10:42:53 tron Exp $
Fix resource leak found by Coverity scan of the NetBSD sources.
--- edit.c.orig 2005-12-03 21:20:32.000000000 +0100
+++ edit.c
@@ -711,7 +711,8 @@ use_logfile(filename)
*/
filename = shell_unquote(filename);
exists = open(filename, OPEN_READ);
- close(exists);
+ if (exists >= 0)
+ close(exists);
exists = (exists >= 0);
/*