* path.cc (cygwin_create_path): Free memory on error.
This commit is contained in:
parent
9e40fe8112
commit
27f1db48c7
|
@ -1,3 +1,7 @@
|
|||
2010-04-20 Christopher Faylor <me+cygwin@cgf.cx>
|
||||
|
||||
* path.cc (cygwin_create_path): Free memory on error.
|
||||
|
||||
2010-04-20 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* cygheap.h (struct init_cygheap): Add rlim_core member.
|
||||
|
|
|
@ -2812,11 +2812,14 @@ cygwin_create_path (cygwin_conv_path_t what, const void *from)
|
|||
void *to;
|
||||
ssize_t size = cygwin_conv_path (what, from, NULL, 0);
|
||||
if (size <= 0)
|
||||
return NULL;
|
||||
if (!(to = malloc (size)))
|
||||
return NULL;
|
||||
to = NULL;
|
||||
else if (!(to = malloc (size)))
|
||||
to = NULL;
|
||||
if (cygwin_conv_path (what, from, to, size) == -1)
|
||||
return NULL;
|
||||
{
|
||||
free (to);
|
||||
to = NULL;
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue