fixed dereferencing issue in markdown_load() and removed dead code in free_deck(...
authorMichael Göhler <somebody.here@gmx.de>
Mon, 19 Jan 2015 20:54:26 +0000 (21:54 +0100)
committerMichael Göhler <somebody.here@gmx.de>
Mon, 19 Jan 2015 20:54:53 +0000 (21:54 +0100)
src/markdown.c
src/parser.c

index 8471724..05c77be 100644 (file)
@@ -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;
     }
index b400610..f835a5c 100644 (file)
@@ -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();