projects
/
sxemacs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e3cb02
)
Coverity CID 52: Forward null
author
Nelson Ferreira
<nelson.ferreira@ieee.org>
Sat, 11 Feb 2012 02:07:57 +0000
(21:07 -0500)
committer
Nelson Ferreira
<nelson.ferreira@ieee.org>
Sat, 11 Feb 2012 02:07:57 +0000
(21:07 -0500)
* src/ui/X11/xgccache.c (gc_cache_lookup): Only dereference
cell/cache->head if not NULL
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/ui/X11/xgccache.c
patch
|
blob
|
history
diff --git
a/src/ui/X11/xgccache.c
b/src/ui/X11/xgccache.c
index
2512b1f
..
8309760
100644
(file)
--- a/
src/ui/X11/xgccache.c
+++ b/
src/ui/X11/xgccache.c
@@
-233,8
+233,10
@@
GC gc_cache_lookup(struct gc_cache *cache, XGCValues * gcv, unsigned long mask)
*/
{
cell = cache->head;
- cache->head = cell->next;
- cache->head->prev = 0;
+ if (cache->head != null) {
+ cache->head = cell->next;
+ cache->head->prev = 0;
+ }
if (cache->tail == cell)
cache->tail = 0; /* only one */
XFreeGC(cache->dpy, cell->gc);