mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-09-13 06:23:45 -04:00
17 lines
395 B
Plaintext
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);
|
|
|
|
/*
|