[Libreoffice-commits] .: desktop/unx

Caolán McNamara caolan at kemper.freedesktop.org
Mon Jun 27 09:13:04 PDT 2011


 desktop/unx/source/start.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 5553f18bd0b6c19e06b7d9285e4aac54826d2f42
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 27 16:54:57 2011 +0100

    valgrind: fix leaks

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index 4937ca8..a3a8ed6 100755
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -866,6 +866,10 @@ exec_javaldx (Args *args)
     if( err != osl_Process_E_None)
     {
         fprintf (stderr, "Warning: failed to launch javaldx - java may not fuction correctly\n");
+        if (javaldx)
+            osl_freeProcessHandle(javaldx);
+        if (fileOut)
+            osl_closeFile(fileOut);
         return;
     } else {
         char *chomp;
@@ -876,6 +880,10 @@ exec_javaldx (Args *args)
 
         if (bytes_read <= 0) {
             fprintf (stderr, "Warning: failed to read path from javaldx\n");
+            if (javaldx)
+                osl_freeProcessHandle(javaldx);
+            if (fileOut)
+                osl_closeFile(fileOut);
             return;
         }
         newpath[bytes_read] = '\0';
@@ -889,7 +897,10 @@ exec_javaldx (Args *args)
 #endif
     extend_library_path (newpath);
 
-    osl_freeProcessHandle(javaldx);
+    if (javaldx)
+        osl_freeProcessHandle(javaldx);
+    if (fileOut)
+        osl_closeFile(fileOut);
 }
 
 SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )


More information about the Libreoffice-commits mailing list