X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftex.c;h=7a09c5eae60df1e7d3c6605d6cf430e2a2044674;hb=8539b9672ca634e0bedf7a531709e845a6b451d6;hp=1a4f22fe09a3412e6949300a32ee24fc5c83dab7;hpb=6132656980af2e8527e3e83c8418846ef4c478c7;p=pspp diff --git a/src/output/tex.c b/src/output/tex.c index 1a4f22fe09..7a09c5eae6 100644 --- a/src/output/tex.c +++ b/src/output/tex.c @@ -175,7 +175,11 @@ post_process_tokens (FILE *file, struct ll_list *list) if (nt->cat == CAT_SPACE || nt->cat == CAT_EOL) break; if (prev_x && (prev_x->cat == CAT_COMMENT) && (nt->cat != CAT_COMMENT)) - break; + { + ds_destroy (&prev_x->str); + free (prev_x); + break; + } word_len += ds_length (&nt->str); prev_x = nt; } @@ -184,6 +188,11 @@ post_process_tokens (FILE *file, struct ll_list *list) { fputs ("\n", file); line_len = 0; + if (tt) + { + ds_destroy (&tt->str); + free (tt); + } continue; } }