subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1557687 - /subversion/trunk/subversion/libsvn_ra_serf/update.c
Date Mon, 13 Jan 2014 12:12:55 GMT
Author: rhuijben
Date: Mon Jan 13 12:12:55 2014
New Revision: 1557687

URL: http://svn.apache.org/r1557687
Log:
Following up on r1557287, resolve the same leak in the other location where we
create temporary buckets to throttle the xml parser. Also avoid using a
cleared pool by allocating the serf allocator in the right pool.

* subversion/libsvn_ra_serf/update.c
  (process_pending): Explicitly destroy bucket after passing it to the inner
    handler.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/update.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/update.c?rev=1557687&r1=1557686&r2=1557687&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/update.c Mon Jan 13 12:12:55 2014
@@ -2399,12 +2399,13 @@ process_pending(update_delay_baton_t *ud
       const char *data;
       apr_size_t len;
       svn_boolean_t at_eof = FALSE;
+      serf_bucket_t *tmp_bucket;
       svn_error_t *err;
 
       if (!iterpool)
         {
           iterpool = svn_pool_create(scratch_pool);
-          alloc = serf_bucket_allocator_create(iterpool, NULL, NULL);
+          alloc = serf_bucket_allocator_create(scratch_pool, NULL, NULL);
         }
       else
         svn_pool_clear(iterpool);
@@ -2416,19 +2417,18 @@ process_pending(update_delay_baton_t *ud
           if (!udb->report->report_received)
             break;
 
-          data = "";
           at_eof = TRUE;
+          tmp_bucket = serf_bucket_simple_create("", 0, NULL, NULL, alloc);
         }
+      else
+        tmp_bucket = svn_ra_serf__create_bucket_with_eagain(data, len, alloc);
 
       /* If not at EOF create a bucket that finishes with EAGAIN, otherwise
          use a standard bucket with default EOF handling */
-      err = udb->inner_handler(NULL /* allowed? */,
-                               at_eof
-                                ? serf_bucket_simple_create(
-                                         data, len, NULL, NULL, alloc)
-                                : svn_ra_serf__create_bucket_with_eagain(
-                                         data, len, alloc),
-                                  udb->inner_handler_baton, iterpool);
+      err = udb->inner_handler(NULL /* allowed? */, tmp_bucket,
+                               udb->inner_handler_baton, iterpool);
+
+      serf_bucket_destroy(tmp_bucket);
 
       if (err && APR_STATUS_IS_EAGAIN(err->apr_err))
         {



Mime
View raw message