Safeguard against NULL pointers
This commit is contained in:
parent
712ed8ac77
commit
33a3557910
|
|
@ -1030,10 +1030,17 @@ static char *get_terminal_name(char* element, char *numberstr, NGHASHPTR instanc
|
|||
for (i = 0; i <= numnodes; i++)
|
||||
thisline = nexttok(thisline);
|
||||
subcktname = gettok(&thisline);
|
||||
|
||||
/*Search for the corresponding .subckt line*/
|
||||
struct card_assoc* allsubs = xcard->level->subckts;
|
||||
|
||||
while (allsubs) {
|
||||
xcardsubsline = allsubs->line->line;
|
||||
/* safeguard against NULL pointers) */
|
||||
if (!subcktname || !allsubs->name) {
|
||||
tfree(subcktname);
|
||||
return tprintf("n%s", numberstr);
|
||||
}
|
||||
if (cieq(subcktname, allsubs->name))
|
||||
break;
|
||||
allsubs = allsubs->next;
|
||||
|
|
|
|||
Loading…
Reference in New Issue