X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Ftex.c;h=7a09c5eae60df1e7d3c6605d6cf430e2a2044674;hb=9165b88a0a735f26977d9d556294d8e50efb9bfe;hp=698abaa453347e04cb877fd44bc8ea19a9707362;hpb=5ce9c6ba1502e623ec6723a8273da77e5858b8d4;p=pspp diff --git a/src/output/tex.c b/src/output/tex.c index 698abaa453..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; } } @@ -329,7 +338,7 @@ tex_submit (struct output_driver *driver, const struct output_item *item) break; case OUTPUT_ITEM_GROUP: - NOT_REACHED (); + break; case OUTPUT_ITEM_IMAGE: {