From fb2e5dc1422710e2429a746519a5bd64fe319ec0 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Tue, 7 Aug 2007 22:03:11 +0000 Subject: [PATCH] Fixed crash/freeze bug in compiler where free was being used on a bad pointer (was an oversight when adding deprecation support for macros) --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401273 --- sourcepawn/compiler/sclist.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sourcepawn/compiler/sclist.c b/sourcepawn/compiler/sclist.c index 64bc7e60..a2e83296 100644 --- a/sourcepawn/compiler/sclist.c +++ b/sourcepawn/compiler/sclist.c @@ -62,6 +62,7 @@ static stringpair *insert_stringpair(stringpair *root,char *first,char *second,i cur->first=duplicatestring(first); cur->second=duplicatestring(second); cur->matchlength=matchlength; + cur->documentation=NULL; if (cur->first==NULL || cur->second==NULL) { if (cur->first!=NULL) free(cur->first); @@ -343,6 +344,11 @@ SC_FUNC int delete_subst(char *name,int length) item=find_stringpair(item,name,length); if (item==NULL) return FALSE; + if (item->documentation) + { + free(item->documentation); + item->documentation=NULL; + } delete_stringpair(&substpair,item); adjustindex(*name); return TRUE;