On Thu, Jul 25, 2013 at 1:39 PM, Bert Huijben <b...@qqmail.nl> wrote: > This patch will allocate the string twice, because hash puts evaluates > its argument twice. > > This should use a tempvar or the Apr hash function directly
Well looks like we've got quite a bit of cleanup to do then... [breser@fmri subversion]$ ack 'svn_hash_sets.*apr_' --noheading --nobreak svn/notify.c:95: svn_hash_sets(hash, apr_pstrdup(nb->conflict_stats->stats_pool, path), ""); svn/cl-conflicts.c:320: svn_hash_sets(att_hash, "revision", apr_ltoa(pool, version->peg_rev)); bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:190: svn_hash_sets(hash, apr_pstrmemdup(pool, key, retlen), val); bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c:1529: svn_hash_sets(data->apr_hash, apr_pstrdup(data->pool, StringValuePtr(key)), libsvn_client/prop_commands.c:702: svn_hash_sets(b->props, apr_pstrdup(b->pool, local_abspath), libsvn_client/commit_util.c:931: svn_hash_sets(danglers, apr_pstrdup(result_pool, parent_abspath), libsvn_client/locking_commands.c:452: svn_hash_sets(path_tokens, path, apr_pstrdup(pool, lock->token)); libsvn_client/copy_foreign.c:168: svn_hash_sets(db->properties, apr_pstrdup(db->pool, name), libsvn_client/copy_foreign.c:314: svn_hash_sets(fb->properties, apr_pstrdup(fb->pool, name), libsvn_client/merge.c:11087: svn_hash_sets(new_catalog, apr_pstrdup(scratch_pool, source_path), libsvn_client/commit.c:380: svn_hash_sets(wc_items, apr_pstrdup(scratch_pool, wcroot_abspath), libsvn_subr/mergeinfo.c:1877: svn_hash_sets(*mergeinfo, apr_pstrdup(result_pool, path), libsvn_subr/mergeinfo.c:2009: svn_hash_sets(new_mergeinfo_catalog, apr_pstrdup(pool, key), libsvn_subr/mergeinfo.c:2496: svn_hash_sets(*adjusted_mergeinfo, apr_pstrdup(result_pool, path), libsvn_subr/subst.c:1521: svn_hash_sets(copy, apr_pstrdup(result_pool, key), libsvn_subr/types.c:328: svn_hash_sets(new_entry->changed_paths2, apr_pstrdup(pool, key), libsvn_subr/dso.c:95: svn_hash_sets(dso_cache, apr_pstrdup(dso_pool, fname), NOT_THERE); libsvn_subr/dso.c:101: svn_hash_sets(dso_cache, apr_pstrdup(dso_pool, fname), *dso); libsvn_repos/log.c:1875: svn_hash_sets(mergeinfo, apr_pstrdup(processed_pool, path), ranges); libsvn_repos/fs-wrap.c:619: svn_hash_sets(b->locks, apr_pstrdup(hash_pool, lock->path), libsvn_repos/hooks.c:384: svn_hash_sets(bo->hooks_env, apr_pstrdup(result_pool, bo->section), libsvn_repos/hooks.c:387: svn_hash_sets(hook_env, apr_pstrdup(result_pool, name), libsvn_fs_fs/tree.c:3847: svn_hash_sets(result_catalog, apr_pstrdup(result_pool, kid_path), libsvn_fs_base/tree.c:5302: svn_hash_sets(result_catalog, apr_pstrdup(result_pool, path), libsvn_wc/diff_editor.c:1552: svn_hash_sets(pb->compared, apr_pstrdup(pb->pool, db->name), ""); libsvn_wc/diff_editor.c:1629: svn_hash_sets(pb->compared, apr_pstrdup(pb->pool, db->name), ""); libsvn_wc/diff_editor.c:1837: svn_hash_sets(pb->compared, apr_pstrdup(pb->pool, fb->name), ""); libsvn_wc/diff_editor.c:1910: svn_hash_sets(pb->compared, apr_pstrdup(pb->pool, fb->name), ""); libsvn_wc/status.c:1562: svn_hash_sets(stat_hash, apr_pstrdup(hash_pool, path), libsvn_wc/status.c:1645: svn_hash_sets(statushash, apr_pstrdup(pool, local_abspath), statstruct); libsvn_wc/wc_db.c:8647: svn_hash_sets(nodes, apr_pstrdup(result_pool, name), child); libsvn_wc/wc_db.c:8730: svn_hash_sets(conflicts, apr_pstrdup(result_pool, name), ""); libsvn_wc/wc_db.c:8972: svn_hash_sets(*nodes, apr_pstrdup(result_pool, name), child); libsvn_wc/workqueue.c:1658: svn_hash_sets(wqb->record_map, apr_pstrdup(wqb->result_pool, local_abspath), libsvn_wc/upgrade.c:205: svn_hash_sets(*all_wcprops, apr_pstrdup(result_pool, name), wcprops); libsvn_wc/update_editor.c:1857: svn_hash_sets(pb->deletion_conflicts, apr_pstrdup(pb->pool, base), libsvn_wc/update_editor.c:3169: svn_hash_sets(pb->not_present_files, apr_pstrdup(pb->pool, fb->name), libsvn_wc/update_editor.c:3277: svn_hash_sets(pb->not_present_files, apr_pstrdup(pb->pool, fb->name), libsvn_wc/update_editor.c:3382: svn_hash_sets(pb->not_present_files, apr_pstrdup(pb->pool, fb->name), libsvn_wc/entries.c:1923: svn_hash_sets(tree_conflicts, apr_pstrdup(result_pool, key), libsvn_wc/wc_db_wcroot.c:869: svn_hash_sets(db->dir_data, apr_pstrdup(db->state_pool, parent_dir), libsvn_wc/wc_db_wcroot.c:908: svn_hash_sets(db->dir_data, svn__apr_hash_index_key(hi), NULL); svnrdump/dump_editor.c:672: svn_hash_sets(pb->deleted_entries, apr_pstrdup(pb->eb->pool, path), pb); svnrdump/dump_editor.c:903: svn_hash_sets(db->deleted_props, apr_pstrdup(db->pool, name), ""); svnrdump/dump_editor.c:931: svn_hash_sets(fb->deleted_props, apr_pstrdup(fb->pool, name), ""); libsvn_delta/compat.c:1050: svn_hash_sets(changes, apr_pstrdup(result_pool, relpath), change);