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
parentb42441d32b5a08a8d0e192535aaf7230236b2865 (diff)
* sec_helper.cc (security_descriptor::realloc): Call free first if
current security desriptor has been allocated by GetSecurityInfo.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/sec_helper.cc3
2 files changed, 8 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 5cf39820d..4922d6120 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-31 Corinna Vinschen <corinna@vinschen.de>
+
+ * sec_helper.cc (security_descriptor::realloc): Call free first if
+ current security desriptor has been allocated by GetSecurityInfo.
+
2009-10-30 Corinna Vinschen <corinna@vinschen.de>
* sec_helper.cc (security_descriptor::free): If sd_size is 0, call
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;