diff --git a/scp.c b/scp.c index 62428a25..08069fd8 100644 --- a/scp.c +++ b/scp.c @@ -15730,7 +15730,7 @@ while (t->function_name) { if (*remainder != '\0') return sim_messagef (SCPE_IERR, "function: %s (\"\", gbuf, 0); returned a non empty string: \"%s\"\n", t->function_name, remainder); - while (*input) { + while ((input != NULL) && (*input != '\0')) { char end_char_string[32]; if (sim_isprint (d->end_char)) diff --git a/sim_fio.c b/sim_fio.c index f162bff8..e912e2de 100644 --- a/sim_fio.c +++ b/sim_fio.c @@ -332,6 +332,7 @@ if (((*file == '"') && (file[strlen (file) - 1] == '"')) || if (without_quotes == NULL) return NULL; if (SCPE_OK != sim_decode_quoted_string (file, without_quotes, &dsize)) { + free (without_quotes); errno = EINVAL; return NULL; }