[PATCH] coverity#982969 Resource leak

Norbert Thiebaud (via Code Review) gerrit at gerrit.libreoffice.org
Tue May 14 02:50:13 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3902

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/02/3902/1

coverity#982969 Resource leak

Change-Id: Iabf637be4b704de4165c5cefb6a19687a1b5637a
---
M desktop/unx/source/start.c
1 file changed, 4 insertions(+), 2 deletions(-)



diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 040110e..a488f95 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -380,8 +380,10 @@
 #endif
 
     if ( connect( fd, (struct sockaddr *)&addr, len ) < 0 )
-        return -1;
-
+    {
+        close(fd);
+        fd = -1;
+    }
     return fd;
 }
 

-- 
To view, visit https://gerrit.libreoffice.org/3902
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabf637be4b704de4165c5cefb6a19687a1b5637a
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Norbert Thiebaud <nthiebaud at gmail.com>



More information about the LibreOffice mailing list