Browse Source

Commit ad0f59657 ("fix a memory leak", 2018-08-13) made

the special device parameter notation @m1[vt0] unusable.
This fix frees only the tokens that are already overridden
in function INPinsertNofree(). The reason for using this
function instead of INPinsert() is not obvious.
pre-master-46
Holger Vogt 8 years ago
parent
commit
2a3c88add6
  1. 11
      src/frontend/outitf.c

11
src/frontend/outitf.c

@ -449,6 +449,7 @@ addSpecialDesc(runDesc *run, char *name, char *devname, char *param, int depind)
{
dataDesc *data;
char *unique, *freeunique; /* unique char * from back-end */
int ret;
if (!run->numData)
run->data = TMALLOC(dataDesc, 1);
@ -463,11 +464,12 @@ addSpecialDesc(runDesc *run, char *name, char *devname, char *param, int depind)
freeunique = unique = copy(devname);
/* MW. My "special" routine here */
INPinsertNofree(&unique, ft_curckt->ci_symtab);
data->specName = copy(unique);
/* unique will be overridden, if it already exists */
ret = INPinsertNofree(&unique, ft_curckt->ci_symtab);
data->specName = unique;
tfree(freeunique);
if (ret == E_EXISTS)
tfree(freeunique);
data->specParamName = copy(param);
@ -1253,7 +1255,6 @@ freeRun(runDesc *run)
for (i = 0; i < run->numData; i++) {
tfree(run->data[i].name);
tfree(run->data[i].specParamName);
tfree(run->data[i].specName);
}
tfree(run->data);

Loading…
Cancel
Save