X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2Fmarkdown.c;h=c03d307740812dcb65f8e0765966e375b0f8eeb5;hb=354cf2e07ccd0d7900f96bffc279093997cbe203;hp=22ebdbfdb18af61fe663ed74d1184d467c8d3b55;hpb=3ee3024232ec7ce4327293afd3f259c0179956ac;p=smdp.git diff --git a/src/markdown.c b/src/markdown.c index 22ebdbf..c03d307 100644 --- a/src/markdown.c +++ b/src/markdown.c @@ -1,6 +1,6 @@ /* * An implementation of markdown objects. - * Copyright (C) 2014 Michael Goehler + * Copyright (C) 2018 Michael Goehler * * This file is part of mdp. * @@ -43,7 +43,7 @@ slide_t *new_slide() { slide_t *x = malloc(sizeof(slide_t)); x->line = NULL; x->prev = x->next = NULL; - x->lines = 0; + x->lines = x->stop = 0; return x; } @@ -66,7 +66,8 @@ void free_line(line_t *line) { line_t *next; while (line) { next = line->next; - (line->text->delete)(line->text); + if(line->text) + (line->text->delete)(line->text); free(line); line = next; }