parser/inppas3.c, fix memory ownership
`INPgetTok()' creates `nodename' which is then committed to `INPtermInsert()'
This commit is contained in:
parent
ddf01dbe3f
commit
ffee2a6b5f
|
|
@ -84,10 +84,11 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
|
||||||
/* check to see if in the form V(xxx) and grab the xxx */
|
/* check to see if in the form V(xxx) and grab the xxx */
|
||||||
if( (*name == 'V' || *name == 'v') && !name[1] ) {
|
if( (*name == 'V' || *name == 'v') && !name[1] ) {
|
||||||
/* looks like V - must be V(xx) - get xx now*/
|
/* looks like V - must be V(xx) - get xx now*/
|
||||||
INPgetTok(&line,&name,1);
|
char *nodename;
|
||||||
if (INPtermInsert(ckt,&name,tab,&node1)!=E_EXISTS)
|
INPgetTok(&line,&nodename,1);
|
||||||
|
if (INPtermInsert(ckt,&nodename,tab,&node1)!=E_EXISTS)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Warning : Nodeset on non-existant node - %s\n", name);
|
"Warning : Nodeset on non-existant node - %s\n", nodename);
|
||||||
ptemp.rValue = INPevaluate(&line,&error,1);
|
ptemp.rValue = INPevaluate(&line,&error,1);
|
||||||
IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL));
|
IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL));
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -122,10 +123,11 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
|
||||||
}
|
}
|
||||||
if( (*name == 'V' || *name == 'v') && !name[1] ) {
|
if( (*name == 'V' || *name == 'v') && !name[1] ) {
|
||||||
/* looks like V - must be V(xx) - get xx now*/
|
/* looks like V - must be V(xx) - get xx now*/
|
||||||
INPgetTok(&line,&name,1);
|
char *nodename;
|
||||||
if (INPtermInsert(ckt,&name,tab,&node1)!=E_EXISTS)
|
INPgetTok(&line,&nodename,1);
|
||||||
|
if (INPtermInsert(ckt,&nodename,tab,&node1)!=E_EXISTS)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Warning : IC on non-existant node - %s\n", name);
|
"Warning : IC on non-existant node - %s\n", nodename);
|
||||||
ptemp.rValue = INPevaluate(&line,&error,1);
|
ptemp.rValue = INPevaluate(&line,&error,1);
|
||||||
IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL));
|
IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue