aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-08-08 19:28:34 +0000
committerChristopher Faylor <me@cgf.cx>2003-08-08 19:28:34 +0000
commitb344f1876c90d48d2d0921a2ffcb6e374eafef67 (patch)
tree8a443a28b03297f226a800e3938ff87deb6b7d3e
parent61bbf8b2b7cbfd8d97d8d17eaad58c9fec91d64c (diff)
downloadnewlib-b344f1876c90d48d2d0921a2ffcb6e374eafef67.zip
newlib-b344f1876c90d48d2d0921a2ffcb6e374eafef67.tar.gz
newlib-b344f1876c90d48d2d0921a2ffcb6e374eafef67.tar.bz2
* grp.cc (read_group): Set __group32.gr_mem pointer back to &null_ptr after
free() is called.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/grp.cc5
2 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f796140..39c3a67 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-08 David Rothenberger <daveroth@acm.org>
+
+ * grp.cc (read_group): Set __group32.gr_mem pointer back to &null_ptr
+ after free() is called.
+
2003-08-05 Christopher Faylor <cgf@redhat.com>
* Makefile.in: Rework to accommodate new speclib arguments.
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index c83c1e5..5b93ec7 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -75,7 +75,10 @@ pwdgrp::read_group ()
{
for (int i = 0; i < gr.curr_lines; i++)
if ((*group_buf)[i].gr_mem != &null_ptr)
- free ((*group_buf)[i].gr_mem);
+ {
+ free ((*group_buf)[i].gr_mem);
+ (*group_buf)[i].gr_mem = &null_ptr;
+ }
load ("/etc/group");