memory bug corrected

This commit is contained in:
cvs
2000-04-07 14:24:01 +00:00
parent 9c9a2d45a5
commit c70f0b7cb8
12 changed files with 45 additions and 25 deletions

View File

@@ -146,7 +146,7 @@ CocVar *CocDefVar(const char *name, void *var, int type, int *flag) {
assert(varListHdl!=NULL);
p=CocFindVar1(*varListHdl, name);
if (p==NULL) {
p=malloc(sizeof(*p));
p=my_malloc(sizeof(*p), name);
p->next=*varListHdl;
*varListHdl=p;
str_copy(p->name, name);
@@ -238,7 +238,8 @@ void CocFreeVarList(CocVar **varList) {
p=v;
v=p->next;
p->next=NULL;
free(p);
printf("my_free %s\n", p->name);
my_free(p);
}
*varList=NULL;
}