aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-10-31 09:31:47 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-10-31 09:31:47 +0000
commit7c16c02dbb98f6d35bd895b23d2ff71df5109a34 (patch)
tree93b6ae62368fabeac37f28f3731329ae6ac1f3f3 /winsup
parentb42441d32b5a08a8d0e192535aaf7230236b2865 (diff)
downloadnewlib-7c16c02dbb98f6d35bd895b23d2ff71df5109a34.zip
newlib-7c16c02dbb98f6d35bd895b23d2ff71df5109a34.tar.gz
newlib-7c16c02dbb98f6d35bd895b23d2ff71df5109a34.tar.bz2
* sec_helper.cc (security_descriptor::realloc): Call free first if
current security desriptor has been allocated by GetSecurityInfo.
Diffstat (limited to 'winsup')
-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 5cf3982..4922d61 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 f8e0145..755cab7 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;