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:
authorCorinna Vinschen <corinna@vinschen.de>2009-10-31 12:31:47 +0300
committerCorinna Vinschen <corinna@vinschen.de>2009-10-31 12:31:47 +0300
commit7c16c02dbb98f6d35bd895b23d2ff71df5109a34 (patch)
tree93b6ae62368fabeac37f28f3731329ae6ac1f3f3 /winsup/cygwin/sec_helper.cc
parentb42441d32b5a08a8d0e192535aaf7230236b2865 (diff)
* sec_helper.cc (security_descriptor::realloc): Call free first if
current security desriptor has been allocated by GetSecurityInfo.
Diffstat (limited to 'winsup/cygwin/sec_helper.cc')
-rw-r--r--winsup/cygwin/sec_helper.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index f8e01452f..755cab78f 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -288,6 +288,9 @@ security_descriptor::realloc (size_t nsize)
{
PSECURITY_DESCRIPTOR tmp;
+ /* Can't re-use buffer allocated by GetSecurityInfo. */
+ if (psd && !sd_size)
+ free ();
if (!(tmp = (PSECURITY_DESCRIPTOR) ::realloc (psd, nsize)))
return NULL;
sd_size = nsize;