aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-05-18 02:45:46 +0000
committerUlrich Drepper <drepper@redhat.com>2008-05-18 02:45:46 +0000
commitb21595750e4feda0c0478579070d98f41b4f845f (patch)
treeafc200275e36497a35ed12f06df34bd9af4ff4b3
parent5c9629d2e301203760464196e2603c410fefced4 (diff)
downloadglibc-b21595750e4feda0c0478579070d98f41b4f845f.tar
glibc-b21595750e4feda0c0478579070d98f41b4f845f.tar.gz
glibc-b21595750e4feda0c0478579070d98f41b4f845f.tar.bz2
glibc-b21595750e4feda0c0478579070d98f41b4f845f.zip
* nscd/mem.c (gc): Fix test for stack overuse.
-rw-r--r--ChangeLog2
-rw-r--r--nscd/mem.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4333d1c769..315b472b89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2008-05-17 Ulrich Drepper <drepper@redhat.com>
+ * nscd/mem.c (gc): Fix test for stack overuse.
+
* nscd/aicache.c (addhstaiX): Fix a few small problems, cleanups,
more asserts.
diff --git a/nscd/mem.c b/nscd/mem.c
index 14928d633c..21f2ae821d 100644
--- a/nscd/mem.c
+++ b/nscd/mem.c
@@ -132,12 +132,12 @@ gc (struct database_dyn *db)
stack_used = 0;
size_t memory_needed = ((db->head->first_free / BLOCK_ALIGN + BITS - 1)
/ BITS) * sizeof (BITMAP_T);
- if (memory_needed <= MAX_STACK_USE)
+ if (stack_used + memory_needed <= MAX_STACK_USE)
{
mark = (BITMAP_T *) alloca (memory_needed);
mark_use_malloc = false;
memset (mark, '\0', memory_needed);
- stack_used = memory_needed;
+ stack_used += memory_needed;
}
else
{