diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-03-14 03:41:28 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-03-14 03:41:28 +0000 |
commit | 099e52769a0601bca9d731209465d6205cd63fc9 (patch) | |
tree | 8ce6e4b6e2c07845222f8ab1a042285fe0d7e4fd | |
parent | 03a3384fe8985419d8ec9507458a8808dafa2758 (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-- | ChangeLog | 7 | ||||
-rw-r--r-- | difs/cache.c | 3 |
2 files changed, 9 insertions, 1 deletions
@@ -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; } |