void *Next;
const char* KeyStr;
+ if (Hash == NULL)
+ return 0;
+
for (i=0; i < Hash->nMembersUsed; i++) {
if (i==0) {
Previous = NULL;
const char *bla = "";
long key;
long i;
+
+ if (Hash == NULL)
+ return 0;
+
if (Hash->MyKeys != NULL)
free (Hash->MyKeys);
Payload **NewPayloadArea;
HashKey **NewTable;
+ if (Hash == NULL)
+ return ;
+
/** double our payload area */
NewPayloadArea = (Payload**) malloc(sizeof(Payload*) * Hash->MemberSize * 2);
memset(&NewPayloadArea[Hash->MemberSize], 0, sizeof(Payload*) * Hash->MemberSize);
Payload *NewPayloadItem;
HashKey *NewHashKey;
+ if (Hash == NULL)
+ return;
+
if (Hash->nMembersUsed >= Hash->MemberSize)
IncreaseHashSize (Hash);
{
long SearchPos;
+ if (Hash == NULL)
+ return 0;
+
for (SearchPos = 0; SearchPos < Hash->nMembersUsed; SearchPos ++) {
if (Hash->LookupTable[SearchPos]->Key == HashBinKey){
return SearchPos;
long SearchPos;
long StepWidth;
+ if (Hash == NULL)
+ return 0;
+
if (Hash->tainted)
return FindInTaintedHash(Hash, HashBinKey);
*/
inline static long CalcHashKey (HashList *Hash, const char *HKey, long HKLen)
{
+ if (Hash == NULL)
+ return 0;
+
if (Hash->Algorithm == NULL)
return hashlittle(HKey, HKLen, 9283457);
else
long HashBinKey;
long HashAt;
+ if (Hash == NULL)
+ return;
+
/** first, find out were we could fit in... */
HashBinKey = CalcHashKey(Hash, HKey, HKLen);
HashAt = FindInHash(Hash, HashBinKey);
long HashBinKey;
long HashAt;
+ if (Hash == NULL)
+ return 0;
+
if (HKLen <= 0) {
*Data = NULL;
return 0;
int GetHashKeys(HashList *Hash, char ***List)
{
long i;
+ if (Hash == NULL)
+ return 0;
if (Hash->MyKeys != NULL)
free (Hash->MyKeys);
*/
void DeleteHashPos(HashPos **DelMe)
{
- free(*DelMe);
- *DelMe = NULL;
+ if (*DelMe != NULL)
+ {
+ free(*DelMe);
+ *DelMe = NULL;
+ }
}
{
long PayloadPos;
- if (Hash->nMembersUsed <= At->Position)
+ if ((Hash == NULL) || (Hash->nMembersUsed <= At->Position))
return 0;
*HKLen = Hash->LookupTable[At->Position]->HKLen;
*HashKey = Hash->LookupTable[At->Position]->HashKey;