Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r--winsup/cygwin/cygheap.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index ded9c252a..561e9330f 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -440,12 +440,14 @@ cygheap_user::~cygheap_user ()
void
cygheap_user::set_name (const char *new_name)
{
- if (strcasematch (new_name, pname))
- return; /* nothing changed */
-
bool allocated = !!pname;
+
if (allocated)
- cfree (pname);
+ {
+ if (strcasematch (new_name, pname))
+ return;
+ cfree (pname);
+ }
pname = cstrdup (new_name ? new_name : "");
if (!allocated)