verify pointer before utilization

This commit is contained in:
dwarning 2018-10-31 08:55:30 +01:00 committed by Holger Vogt
parent 42d29ef49f
commit cc4e4d9bad
3 changed files with 8 additions and 4 deletions

View File

@ -815,8 +815,10 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
/* now load deck into ft_curckt -- the current circuit. */
inp_dodeck(deck, tt, wl_first, FALSE, options, filename);
ft_curckt->devtlist = devtlist;
ft_curckt->modtlist = modtlist;
if (ft_curckt) {
ft_curckt->devtlist = devtlist;
ft_curckt->modtlist = modtlist;
}
/* inp_dodeck did take ownership */
tt = NULL;

View File

@ -1058,7 +1058,8 @@ X11_Input(REQUEST *request, RESPONSE *response)
default:
internalerror("unrecognized input type");
response->option = error_option;
if (response)
response->option = error_option;
return 1;
break;
}

View File

@ -342,7 +342,8 @@ dosim(
if (rawfileFp) {
if (ftell(rawfileFp) == 0) {
(void) fclose(rawfileFp);
(void) unlink(wl->wl_word);
if (wl)
(void) unlink(wl->wl_word);
} else {
(void) fclose(rawfileFp);
}