summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2010-04-09 16:51:08 +0000
committerChristopher Faylor <me@cgf.cx>2010-04-09 16:51:08 +0000
commit412f3e61d4a3e5eca549f87babaa6ebe4c0cace5 (patch)
treed1f37201e7d3cc30afc4ffbe6598e9d8702e1600 /winsup/cygwin/path.cc
parent5d239c6195bf61b49946a232320cdf81d3fac153 (diff)
downloadcygnal-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.cc2
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);
}
}