subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1330651 - in /subversion/branches/1.7.x: ./ STATUS subversion/libsvn_ra_neon/commit.c
Date Thu, 26 Apr 2012 04:02:11 GMT
Author: svn-role
Date: Thu Apr 26 04:02:11 2012
New Revision: 1330651

URL: http://svn.apache.org/viewvc?rev=1330651&view=rev
Log:
Merge r1329388 from trunk:

 * r1329388
   Destroy neon request object so that request cleanups are not delayed.
   Justification:
     Undefined behaviour by using memory after free(); does not appear to
     affect 1.7 but may affect 3rd party clients using the RA API.
   Votes:
     +1: philip, rhuijben, stsp

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/libsvn_ra_neon/commit.c

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1329388

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1330651&r1=1330650&r2=1330651&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Thu Apr 26 04:02:11 2012
@@ -135,14 +135,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1329388
-   Destroy neon request object so that request cleanups are not delayed.
-   Justification:
-     Undefined behaviour by using memory after free(); does not appear to
-     affect 1.7 but may affect 3rd party clients using the RA API.
-   Votes:
-     +1: philip, rhuijben, stsp
-
  * r1330382
    Fix issue 4167, 'svn st -u --xml' on items deleted from repository
    Justification:

Modified: subversion/branches/1.7.x/subversion/libsvn_ra_neon/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_ra_neon/commit.c?rev=1330651&r1=1330650&r2=1330651&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_ra_neon/commit.c Thu Apr 26 04:02:11 2012
@@ -739,6 +739,7 @@ static svn_error_t * commit_open_root(vo
          transaction (and, optionally, a corresponding activity). */
       svn_ra_neon__request_t *req;
       const char *header_val;
+      svn_error_t *err;
 
       SVN_ERR(svn_ra_neon__request_create(&req, cc->ras, "POST",
                                           cc->ras->me_resource, dir_pool));
@@ -751,33 +752,39 @@ static svn_error_t * commit_open_root(vo
                             svn_uuid_generate(dir_pool));
 #endif
 
-      SVN_ERR(svn_ra_neon__request_dispatch(NULL, req, NULL, "( create-txn )",
-                                            201, 0, dir_pool));
-
-      /* Check the response headers for either the virtual transaction
-         details, or the real transaction details.  We need to have
-         one or the other of those!  */
-      if ((header_val = ne_get_response_header(req->ne_req,
-                                               SVN_DAV_VTXN_NAME_HEADER)))
-        {
-          cc->txn_url = svn_path_url_add_component2(cc->ras->vtxn_stub,
-                                                    header_val, cc->pool);
-          cc->txn_root_url
-            = svn_path_url_add_component2(cc->ras->vtxn_root_stub,
-                                          header_val, cc->pool);
-        }
-      else if ((header_val = ne_get_response_header(req->ne_req,
-                                                    SVN_DAV_TXN_NAME_HEADER)))
-        {
-          cc->txn_url = svn_path_url_add_component2(cc->ras->txn_stub,
-                                                    header_val, cc->pool);
-          cc->txn_root_url = svn_path_url_add_component2(cc->ras->txn_root_stub,
-                                                         header_val, cc->pool);
+      err = svn_ra_neon__request_dispatch(NULL, req, NULL, "( create-txn )",
+                                          201, 0, dir_pool);
+      if (!err)
+        {
+          /* Check the response headers for either the virtual transaction
+             details, or the real transaction details.  We need to have
+             one or the other of those!  */
+          if ((header_val = ne_get_response_header(req->ne_req,
+                                                   SVN_DAV_VTXN_NAME_HEADER)))
+            {
+              cc->txn_url = svn_path_url_add_component2(cc->ras->vtxn_stub,
+                                                        header_val, cc->pool);
+              cc->txn_root_url
+                = svn_path_url_add_component2(cc->ras->vtxn_root_stub,
+                                              header_val, cc->pool);
+            }
+          else if ((header_val
+                    = ne_get_response_header(req->ne_req,
+                                             SVN_DAV_TXN_NAME_HEADER)))
+            {
+              cc->txn_url = svn_path_url_add_component2(cc->ras->txn_stub,
+                                                        header_val, cc->pool);
+              cc->txn_root_url
+                = svn_path_url_add_component2(cc->ras->txn_root_stub,
+                                              header_val, cc->pool);
+            }
+          else
+            err = svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+                                    _("POST request did not return transaction "
+                                      "information"));
         }
-      else
-        return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
-                                 _("POST request did not return transaction "
-                                   "information"));
+      svn_ra_neon__request_destroy(req);
+      SVN_ERR(err);
 
       root->rsrc = NULL;
       root->txn_root_url = svn_path_url_add_component2(cc->txn_root_url,



Mime
View raw message