summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2006-03-18 15:18:56 +0000
committerMatthieu Herrb <matthieu.herrb@laas.fr>2006-03-18 15:18:56 +0000
commit2dcc187c92c1a579e6e9f0bad999a3b4e47228c3 (patch)
treeb6f34fd3f9bb6c8e49a53680e64d8cd2e16607ae
parent93421a53ccf159ff39bc9f8ff72c57246f9cb90c (diff)
doublecheck that a pointer is not NULL before dereferencing it. (CoverityXORG-7_0_99_901
CID 121).
-rw-r--r--ChangeLog6
-rw-r--r--src/Attrib.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 20b9b3e..afae7e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-18 Matthieu Herrb <matthieu.herrb@laas.fr>
+
+ * src/Attrib.c: XpmFreeExtensions
+ doublecheck that a pointer is not NULL before dereferencing it.
+ (Coverity CID 121).
+
2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
diff --git a/src/Attrib.c b/src/Attrib.c
index c6b34d6..a6feb52 100644
--- a/src/Attrib.c
+++ b/src/Attrib.c
@@ -133,7 +133,7 @@ XpmFreeExtensions(extensions, nextensions)
XpmFree(ext->name);
nlines = ext->nlines;
for (j = 0, sptr = ext->lines; j < nlines; j++, sptr++)
- if (*sptr)
+ if (sptr && *sptr)
XpmFree(*sptr);
if (ext->lines)
XpmFree(ext->lines);