summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-03-14 03:41:28 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-03-14 03:41:28 +0000
commit099e52769a0601bca9d731209465d6205cd63fc9 (patch)
tree8ce6e4b6e2c07845222f8ab1a042285fe0d7e4fd
parent03a3384fe8985419d8ec9507458a8808dafa2758 (diff)
Check for alloc error was reversed, causing memory leak, NULL pointerXORG-7_0_99_901
dereference (if fsalloc actually failed), and failure to rebuild cache. (Coverity ids #560 & #127).
-rw-r--r--ChangeLog7
-rw-r--r--difs/cache.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fa0c7f1..c343595 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-03-13 Alan Coopersmith <alan.coopersmith@sun.com>
+
+ * difs/cache.c (rebuild_cache):
+ Check for alloc error was reversed, causing memory leak, NULL
+ pointer dereference (if fsalloc actually failed), and failure
+ to rebuild cache. (Coverity ids #560 & #127).
+
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
diff --git a/difs/cache.c b/difs/cache.c
index 2aab91e..905feac 100644
--- a/difs/cache.c
+++ b/difs/cache.c
@@ -1,3 +1,4 @@
+/* $XdotOrg: $ */
/* $Xorg: cache.c,v 1.4 2001/02/09 02:05:42 xorgcvs Exp $ */
/*
Copyright 1987, 1998 The Open Group
@@ -157,7 +158,7 @@ rebuild_cache(CachePtr cache)
if (!tails)
return;
entries = (CacheEntryPtr *) fsalloc(j * sizeof(CacheEntryPtr));
- if (entries) {
+ if (!entries) {
DEALLOCATE_LOCAL(tails);
return;
}