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

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