arrfab / rpms / libreport

Forked from rpms/libreport 5 years ago
Clone

Blame SOURCES/0007-coverity-fix-def9.patch

a6c909
From a9d4eab52e3a30dc0baa730d9a8fd9ab21488110 Mon Sep 17 00:00:00 2001
a6c909
From: Matej Habrnal <mhabrnal@redhat.com>
a6c909
Date: Wed, 18 Jul 2018 17:23:48 +0200
a6c909
Subject: [PATCH] coverity fix [#def9]
a6c909
a6c909
libreport-2.9.5/src/lib/abrt_sock.c:80: negative_returns: "socketfd" is passed
a6c909
to a parameter that cannot be negative.
a6c909
a6c909
https://cov01.lab.eng.brq.redhat.com/el8-results/el8/libreport-2.9.5-2.el8+7/scan-results.html#def9
a6c909
a6c909
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
a6c909
---
a6c909
 src/lib/abrt_sock.c | 3 ++-
a6c909
 1 file changed, 2 insertions(+), 1 deletion(-)
a6c909
a6c909
diff --git a/src/lib/abrt_sock.c b/src/lib/abrt_sock.c
a6c909
index 962ecc96..8b80aac8 100644
a6c909
--- a/src/lib/abrt_sock.c
a6c909
+++ b/src/lib/abrt_sock.c
a6c909
@@ -75,9 +75,10 @@ static int connect_to_abrtd_and_call_DeleteDebugDump(const char *dump_dir_name)
a6c909
                 result = (response[9] - '0') * 100 + (response[10] - '0') * 10 + (response[11] - '0');
a6c909
             }
a6c909
         }
a6c909
+
a6c909
+        close(socketfd);
a6c909
     }
a6c909
 
a6c909
-    close(socketfd);
a6c909
 
a6c909
     return result;
a6c909
 }
a6c909
-- 
a6c909
2.17.1
a6c909