[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[patch] Kill some memory eaters

From: Ben Collins <bcollins_at_debian.org>
Date: 2002-03-07 22:23:33 CET

Here's a few memory leakers I found while searching through apr pool
debug output for a commit. Testsuite runs to completiong with no
problems, with this patch. This includes the patch to svn_wc_entry to
use a subpool, except for the allocation of the entry returned.

  * libsvn_fs/tree.c:

    (open_path): If svn_fs__dag_open returns an SVN_ERR_FS_NOT_FOUND
      error, we don't use the error return, so svn_error_free it.

  * libsvn_wc/entries.c:

    Based on a patch from Kevin Pilch-Bisson.

    (svn_wc_entry): Use a subpool for all allocations and destroy it.
      When we find the entry we want, use svn_wc__entry_dup() to
      allocate it in our primary pool.

    (svn_wc__entry_dup): Check for a NULL entry to dup, and return NULL
      in this case.

  * libsvn_wc/adm_ops.c:

    (process_committed): We don't use the error returned by
      svn_wc__open_adm_file, so svn_error_free it.

  * libsvn_wc/adm_files.c:

    (check_adm_exists): In the case where we don't use the error from
      svn_wc__open_adm_file, svn_error_free the return.

  * libsvn_wc/update_editor.c:

    (apply_textdelta): In the case where we don't use the error from
      svn_wc__open_text_base, svn_error_free the return.

    (svn_wc_is_wc_root): Since we don't use the error return from
      svn_wc_entry, svn_error_free it.

  * libsvn_wc/questions.c:

    (svn_wc_check_wc): Since we don't use the error return from
      svn_wc__open_adm_file, svn_error_free it.

  * libsvn_client/commit.c:

    (send_to_repos): Create and use a subpool for everything except the
      creation of commit_info (which gets returned higher up to the
      caller) via svn_client__make_commit_info. Destroy the subpool.

    (svn_client_commit): Create and use a subpool for everything except
      the call to send_to_repos, which fills in our commit_info struct
      to pass back to our caller. Now, we are truely clean.

-- 
 .----------=======-=-======-=========-----------=====------------=-=-----.
/       Ben Collins    --    Debian GNU/Linux    --    WatchGuard.com      \
`          bcollins@debian.org   --   Ben.Collins@watchguard.com           '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Thu Mar 7 22:28:18 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.