commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r884603 - in /commons/sandbox/runtime/trunk/src/main/native/os: unix/pipe.c win32/pipe.c
Date Thu, 26 Nov 2009 15:46:08 GMT
Author: mturk
Date: Thu Nov 26 15:46:08 2009
New Revision: 884603

URL: http://svn.apache.org/viewvc?rev=884603&view=rev
Log:
Do not leak IOH descriptors

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/pipe.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c?rev=884603&r1=884602&r2=884603&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/pipe.c Thu Nov 26 15:46:08 2009
@@ -186,7 +186,8 @@
     fo = acr_ioh_open(fp, ACR_DT_FILE, 0, file_cleanup);
     if (fo < 0) {
         rc = ACR_GET_OS_ERROR();
-        goto finally;
+        file_cleanup(fp, ACR_DT_FILE, ACR_IOH_CLEAR);
+        return rc;
     }
     /* Create File Descriptor Object */
     *fdo = ACR_DescriptorCreate(_E, ACR_DT_FILE, fo, NULL,
@@ -201,7 +202,7 @@
 finally:
     if (rc) {
         if (fp)
-            file_cleanup(fp, ACR_DT_FILE, ACR_IOH_CLEAR);
+            acr_ioh_clear(fo);
         else
             close(fd);
     }

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/pipe.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/pipe.c?rev=884603&r1=884602&r2=884603&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/pipe.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/pipe.c Thu Nov 26 15:46:08 2009
@@ -396,7 +396,8 @@
     fo = acr_ioh_open(fp, ACR_DT_FILE, 0, file_cleanup);
     if (fo < 0) {
         rc = ACR_GET_OS_ERROR();
-        goto finally;
+        file_cleanup(fp, ACR_DT_FILE, ACR_IOH_CLEAR);
+        return rc;
     }
     /* Create File Descriptor Object */
     *fdo = ACR_DescriptorCreate(_E, ACR_DT_FILE, fo, NULL,
@@ -409,7 +410,7 @@
 
 finally:
     if (rc)
-        file_cleanup(fp, ACR_DT_FILE, ACR_IOH_CLEAR);
+        acr_ioh_clear(fo);
     return rc;
 }
 



Mime
View raw message