Author: rhuijben
Date: Mon Jan 21 11:09:34 2013
New Revision: 1436274

URL: http://svn.apache.org/viewvc?rev=1436274&view=rev
Log:
* trunk/subversion/libsvn_client/patch.c
  (apply_one_patch):
     Resolve segfault, by not closing a file that we didn't open.

Modified:
    subversion/trunk/subversion/libsvn_client/patch.c

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1436274&r1=1436273&r2=1436274&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Mon Jan 21 11:09:34 2013
@@ -2218,14 +2218,17 @@ apply_one_patch(patch_target_t **patch_t
 
   svn_pool_destroy(iterpool);
 
-  /* Now close files we don't need any longer to get their contents
-   * flushed to disk.
-   * But we're not closing the reject file -- it still needed and
-   * will be closed later in write_out_rejected_hunks(). */
-  if (target->kind_on_disk == svn_node_file)
-    SVN_ERR(svn_io_file_close(target->file, scratch_pool));
   if (!target->is_symlink)
-    SVN_ERR(svn_io_file_close(target->patched_file, scratch_pool));
+    {
+      /* Now close files we don't need any longer to get their contents
+       * flushed to disk.
+       * But we're not closing the reject file -- it still needed and
+       * will be closed later in write_out_rejected_hunks(). */
+      if (target->kind_on_disk == svn_node_file)
+        SVN_ERR(svn_io_file_close(target->file, scratch_pool));
+  
+      SVN_ERR(svn_io_file_close(target->patched_file, scratch_pool));
+    }
 
   if (! target->skipped)
     {


Reply via email to