emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#33287: closed ([PATCH] sync: add missing brackets


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#33287: closed ([PATCH] sync: add missing brackets in sync_arg())
Date: Tue, 06 Nov 2018 18:37:02 +0000

Your message dated Tue, 6 Nov 2018 10:35:58 -0800
with message-id <address@hidden>
and subject line Re: bug#33287: [PATCH] sync: add missing brackets in sync_arg()
has caused the debbugs.gnu.org bug report #33287,
regarding [PATCH] sync: add missing brackets in sync_arg()
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
33287: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=33287
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] sync: add missing brackets in sync_arg() Date: Tue, 6 Nov 2018 13:02:24 +0100
Detected by Coverity Analysis:

Error: RESOURCE_LEAK (CWE-772):
coreutils-8.30/src/sync.c:112: open_fn: Returning handle opened by "open".
coreutils-8.30/src/sync.c:112: var_assign: Assigning: "fd" = handle returned 
from "open(file, 2049)".
coreutils-8.30/src/sync.c:115: leaked_handle: Handle variable "fd" going out of 
scope leaks the handle.
113|         if (fd < 0)
114|           error (0, rd_errno, _("error opening %s"), quoteaf (file));
115|->       return false;
116|       }
117|
---
 src/sync.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index bd3671a19..607fa8f7f 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -111,8 +111,10 @@ sync_arg (enum sync_mode mode, char const *file)
       if (open_flags != (O_WRONLY | O_NONBLOCK))
         fd = open (file, O_WRONLY | O_NONBLOCK);
       if (fd < 0)
-        error (0, rd_errno, _("error opening %s"), quoteaf (file));
-      return false;
+        {
+          error (0, rd_errno, _("error opening %s"), quoteaf (file));
+          return false;
+        }
     }
 
   /* We used O_NONBLOCK above to not hang with fifos,
-- 
2.17.2




--- End Message ---
--- Begin Message --- Subject: Re: bug#33287: [PATCH] sync: add missing brackets in sync_arg() Date: Tue, 6 Nov 2018 10:35:58 -0800 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0
Thanks, I installed that and am closing the bug report.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]