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. */ /* now load deck into ft_curckt -- the current circuit. */
inp_dodeck(deck, tt, wl_first, FALSE, options, filename); inp_dodeck(deck, tt, wl_first, FALSE, options, filename);
if (ft_curckt) {
ft_curckt->devtlist = devtlist; ft_curckt->devtlist = devtlist;
ft_curckt->modtlist = modtlist; ft_curckt->modtlist = modtlist;
}
/* inp_dodeck did take ownership */ /* inp_dodeck did take ownership */
tt = NULL; tt = NULL;

View File

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

View File

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