summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2010-09-13 13:34:07 -0700
committerNathan Kinder <nkinder@redhat.com>2010-09-15 09:11:05 -0700
commit7c00bf728c3a8c20c08d76f66cccaf892c81a5f2 (patch)
tree68db2a87bd96bc0adf68765ed0b13133855fe0fd
parent243ba589c5a69a42bdae8459bd3e6d2e65853de8 (diff)
downloadds-7c00bf728c3a8c20c08d76f66cccaf892c81a5f2.tar.gz
ds-7c00bf728c3a8c20c08d76f66cccaf892c81a5f2.tar.xz
ds-7c00bf728c3a8c20c08d76f66cccaf892c81a5f2.zip
Bug 630097 - (cov#11946) NULL dereference in ResHashCreate()
If we jump to the error label due to an error allocating memory for pResHash->treelist, we try to do a free of pResHash->treelist->vlist without checking if pResHash->treelist is NULL. We need to perform this NULL check before dereferencing pResHash->treelist.
-rw-r--r--lib/libsi18n/reshash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libsi18n/reshash.c b/lib/libsi18n/reshash.c
index 4c8e9006..4134b2f9 100644
--- a/lib/libsi18n/reshash.c
+++ b/lib/libsi18n/reshash.c
@@ -276,7 +276,7 @@ ResHash * ResHashCreate(char * name)
goto done;
error:
- if (pResHash->treelist->vlist) free(pResHash->treelist->vlist);
+ if (pResHash->treelist && pResHash->treelist->vlist) free(pResHash->treelist->vlist);
if (pResHash->treelist) free(pResHash->treelist);
if (pResHash) free(pResHash);
return NULL;