From: Michael Göhler Date: Mon, 19 Jan 2015 20:54:26 +0000 (+0100) Subject: fixed dereferencing issue in markdown_load() and removed dead code in free_deck(... X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=aaef0d22541650ed73e094363e1886943ca035d3;p=smdp.git fixed dereferencing issue in markdown_load() and removed dead code in free_deck(), #70 --- diff --git a/src/markdown.c b/src/markdown.c index 8471724..05c77be 100644 --- a/src/markdown.c +++ b/src/markdown.c @@ -81,8 +81,6 @@ void free_deck(deck_t *deck) { while (slide) { free_line(slide->line); next = slide->next; - if (slide == NULL) - return; free(slide); slide = next; } diff --git a/src/parser.c b/src/parser.c index b400610..f835a5c 100644 --- a/src/parser.c +++ b/src/parser.c @@ -82,7 +82,7 @@ deck_t *markdown_load(FILE *input) { } else { // if slide ! has line - if(!slide->line) { + if(!slide->line || !line) { // create new line line = new_line();