diff --git a/src/common/gamecode/study.c b/src/common/gamecode/study.c index c3f129d73..cd1aae8ab 100644 --- a/src/common/gamecode/study.c +++ b/src/common/gamecode/study.c @@ -411,7 +411,7 @@ teach(unit * u, struct order * ord) init_tokens(u2->thisorder); skip_token(); sk = getskill(u2->faction->locale); - parser_pushstate(); + parser_popstate(); if (sk == NOSKILL) { add_message(&u->faction->msgs, diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index b05f7cc2d..ae11afbe1 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -489,6 +489,7 @@ unitorders(FILE * F, struct faction * f) order * ord = *ordp; if (!is_repeated(ord)) { *ordp = ord->next; + ord->next = NULL; free_order(ord); } else { ordp = &ord->next;