Author: hwright
Date: Thu Sep 22 11:31:40 2011
New Revision: 1174068
URL: http://svn.apache.org/viewvc?rev=1174068&view=rev
Log:
Fix a couple of memory issues in the Ev2 shim.
* subversion/libsvn_delta/compat.c
(get_operation): Allocate the hash key in the edit pool.
(svn_editor_from_delta): Populate the root operation struct.
Modified:
subversion/trunk/subversion/libsvn_delta/compat.c
Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1174068&r1=1174067&r2=1174068&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Thu Sep 22 11:31:40 2011
@@ -590,7 +590,8 @@ get_operation(const char *path,
child->rev = SVN_INVALID_REVNUM;
child->kind = svn_node_dir;
child->props = NULL;
- apr_hash_set(operation->children, path, APR_HASH_KEY_STRING, child);
+ apr_hash_set(operation->children, apr_pstrdup(result_pool, path),
+ APR_HASH_KEY_STRING, child);
}
return child;
}
@@ -910,6 +911,12 @@ svn_editor_from_delta(svn_editor_t **edi
eb->fetch_kind_func = fetch_kind_func;
eb->fetch_kind_baton = fetch_kind_baton;
+ eb->root.children = apr_hash_make(result_pool);
+ eb->root.kind = svn_node_dir;
+ eb->root.operation = OP_OPEN;
+ eb->root.props = NULL;
+ eb->root.rev = SVN_INVALID_REVNUM;
+
SVN_ERR(svn_editor_create(&editor, eb, cancel_func, cancel_baton,
result_pool, scratch_pool));
SVN_ERR(svn_editor_setcb_many(editor, &editor_cbs, scratch_pool));