diff options
author | Christopher Faylor <me@cgf.cx> | 2010-04-09 16:51:08 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-04-09 16:51:08 +0000 |
commit | 412f3e61d4a3e5eca549f87babaa6ebe4c0cace5 (patch) | |
tree | d1f37201e7d3cc30afc4ffbe6598e9d8702e1600 /winsup/cygwin/path.cc | |
parent | 5d239c6195bf61b49946a232320cdf81d3fac153 (diff) | |
download | cygnal-412f3e61d4a3e5eca549f87babaa6ebe4c0cace5.tar.gz cygnal-412f3e61d4a3e5eca549f87babaa6ebe4c0cace5.tar.bz2 cygnal-412f3e61d4a3e5eca549f87babaa6ebe4c0cace5.zip |
* path.cc (path_conv::set_normalized_path): Use crealloc_abort to avoid a
memory leak.
* path.h (path_conv::operator =): Just use cstrdup to allocate normalized_path,
avoiding attempt to free a pointer which is allocated in another pc.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index dba96a624..9e57a0f15 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -377,7 +377,7 @@ path_conv::set_normalized_path (const char *path_copy) if (path_copy) { size_t n = strlen (path_copy) + 1; - char *p = (char *) cmalloc_abort (HEAP_STR, n); + char *p = (char *) crealloc_abort ((void *) normalized_path, n); normalized_path = (const char *) memcpy (p, path_copy, n); } } |