Author: philip
Date: Mon Nov 21 13:12:16 2011
New Revision: 1204478

URL: http://svn.apache.org/viewvc?rev=1204478&view=rev
Log:
Fix some cases of using pool memory after it has been freed, identified
by valgrind when running merge_tree_conflict_tests.py 22.

* subversion/libsvn_client/merge.c
  (tree_conflict): Duplicate path into hash pool, this it the problem
   identified by valgrind.
  (tree_conflict_on_add): Do the same for the same code pattern. 

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

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1204478&r1=1204477&r2=1204478&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Mon Nov 21 13:12:16 2011
@@ -592,6 +592,7 @@ tree_conflict(merge_cmd_baton_t *merge_b
 
       if (merge_b->conflicted_paths == NULL)
         merge_b->conflicted_paths = apr_hash_make(merge_b->pool);
+      victim_abspath = apr_pstrdup(merge_b->pool, victim_abspath);
 
       apr_hash_set(merge_b->conflicted_paths, victim_abspath,
                    APR_HASH_KEY_STRING, victim_abspath);
@@ -633,6 +634,7 @@ tree_conflict_on_add(merge_cmd_baton_t *
 
       if (merge_b->conflicted_paths == NULL)
         merge_b->conflicted_paths = apr_hash_make(merge_b->pool);
+      victim_abspath = apr_pstrdup(merge_b->pool, victim_abspath);
 
       apr_hash_set(merge_b->conflicted_paths, victim_abspath,
                    APR_HASH_KEY_STRING, victim_abspath);
@@ -663,6 +665,7 @@ tree_conflict_on_add(merge_cmd_baton_t *
 
       if (merge_b->conflicted_paths == NULL)
         merge_b->conflicted_paths = apr_hash_make(merge_b->pool);
+      victim_abspath = apr_pstrdup(merge_b->pool, victim_abspath);
 
       apr_hash_set(merge_b->conflicted_paths, victim_abspath,
                    APR_HASH_KEY_STRING, victim_abspath);


Reply via email to