Fixed bugs reported by Purify.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@781 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7ccdd2fc6d
commit
5083014aa8
3 changed files with 3 additions and 2 deletions
|
|
@ -297,7 +297,7 @@ hash_first(DOH *ho) {
|
||||||
Hash *h = (Hash *) ObjData(ho);
|
Hash *h = (Hash *) ObjData(ho);
|
||||||
h->currentindex = 0;
|
h->currentindex = 0;
|
||||||
h->current = 0;
|
h->current = 0;
|
||||||
while (!h->hashtable[h->currentindex] && (h->currentindex < h->hashsize))
|
while ((h->currentindex < h->hashsize) && !h->hashtable[h->currentindex])
|
||||||
h->currentindex++;
|
h->currentindex++;
|
||||||
if (h->currentindex >= h->hashsize) return 0;
|
if (h->currentindex >= h->hashsize) return 0;
|
||||||
h->current = h->hashtable[h->currentindex];
|
h->current = h->hashtable[h->currentindex];
|
||||||
|
|
|
||||||
|
|
@ -646,7 +646,7 @@ int replace_simple(String *str, char *token, char *rep, int flags, int count, ch
|
||||||
}
|
}
|
||||||
expand = delta*rcount; /* Total amount of expansion for the replacement */
|
expand = delta*rcount; /* Total amount of expansion for the replacement */
|
||||||
newsize = str->maxsize;
|
newsize = str->maxsize;
|
||||||
while ((str->len + expand) > newsize) newsize *= 2;
|
while ((str->len + expand) >= newsize) newsize *= 2;
|
||||||
|
|
||||||
ns = (char *) DohMalloc(newsize);
|
ns = (char *) DohMalloc(newsize);
|
||||||
assert(ns);
|
assert(ns);
|
||||||
|
|
|
||||||
|
|
@ -688,6 +688,7 @@ GUILE::create_function (char *name, char *iname, SwigType *d, ParmList *l)
|
||||||
Delete(returns);
|
Delete(returns);
|
||||||
Delete(tmp);
|
Delete(tmp);
|
||||||
DelWrapper(f);
|
DelWrapper(f);
|
||||||
|
delete[] wname;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue