Strange… this should never be necessarily when *removing* something from a hash 
(value =NULL).


I think you see some kind of other problem.


Bert






Sent from Surface





From: Philip Martin
Sent: ‎Tuesday‎, ‎June‎ ‎2‎, ‎2015 ‎5‎:‎19‎ ‎PM
To: comm...@subversion.apache.org





Author: philip
Date: Tue Jun  2 15:19:26 2015
New Revision: 1683126

URL: http://svn.apache.org/r1683126
Log:
Avoid using pool memory after clear in FSX.

* subversion/libsvn_fs_x/cached_data.c
  (read_dir_entries): Copy hashed values into hash pool.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/cached_data.c

Modified: subversion/trunk/subversion/libsvn_fs_x/cached_data.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/cached_data.c?rev=1683126&r1=1683125&r2=1683126&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/cached_data.c Tue Jun  2 15:19:26 
2015
@@ -2494,7 +2494,9 @@ read_dir_entries(apr_array_header_t *ent
         {
           /* We must be in incremental mode */
           assert(hash);
-          apr_hash_set(hash, entry.key, entry.keylen, NULL);
+          apr_hash_set(hash,
+                       apr_pstrmemdup(scratch_pool, entry.key, entry.keylen),
+                       entry.keylen, NULL);
           continue;
         }
 
@@ -2534,7 +2536,9 @@ read_dir_entries(apr_array_header_t *ent
       /* In incremental mode, update the hash; otherwise, write to the
        * final array. */
       if (incremental)
-        apr_hash_set(hash, entry.key, entry.keylen, dirent);
+        apr_hash_set(hash,
+                     apr_pstrmemdup(scratch_pool, entry.key, entry.keylen),
+                     entry.keylen, dirent);
       else
         APR_ARRAY_PUSH(entries, svn_fs_x__dirent_t *) = dirent;
     }

Reply via email to