/[Apache-SVN]
ViewVC logotype

Revision 855453


Jump to revision: Previous Next
Author: lundblad
Date: Thu Jul 21 18:45:42 2005 UTC (19 years, 4 months ago)
Changed paths: 1
Log Message:
Fix memory leak in character translation caching.

If apr_xlate_open returned an error, some memory was allocated from a global
pool on every call.  The problem is solved by caching a NULL handle in
this case.

Suggested by: jerenkrantz
              kfogel

* subversion/libsvn_subr/utf.c
  (xlate_handle_node_t): Add valid field.
  (xlate_handle_node_cleanup): Set valid to FALSE instead of resetting the
  handle.
  (get_xlate_handle_node): Fix docstring.
  Initialize valid field of allocated node struct.
  Check the valid field instead of the handle field to make sure
  the handle is valid.  Avoid allocating a node if we're going to return an
  error.  Rename some variables for clarity.
  (svn_utf_stringbuf_to_utf8, svn_utf_string_to_utf8,
  svn_utf_stringbuf_from_utf8, svn_utf_string_from_utf8, 
  svn_utf_cstring_from_utf8, svn_utf_cstring_from_utf8_ex,
  svn_utf_cstring_from_utf8_string): Make sure the xlate handle node
  is always put back into the hash, even on errors and if there
  is no handle.


Changed paths

Path Details
Directorysubversion/trunk/subversion/libsvn_subr/utf.c modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26