cmark

My personal build of CMark ✏️

Commit
c507d164f5856779d23ef030c2a656391707a5ac
Parent
43a607c5aec4bd8d10486861bf2bc627f8846753
Author
John MacFarlane <jgm@berkeley.edu>
Date

Free the string returned by html renderer in main program.

Diffstat

1 file changed, 5 insertions, 1 deletion

Status File Name N° Changes Insertions Deletions
Modified src/main.c 6 5 1
diff --git a/src/main.c b/src/main.c
@@ -17,10 +17,14 @@ void print_usage()
 
 static void print_document(node_block *document, bool ast)
 {
+	unsigned char *result;
 	if (ast) {
 		cmark_debug_print(document);
 	} else {
-		printf("%s", cmark_render_html(document));
+
+		result = cmark_render_html(document);
+		printf("%s", result);
+		free(result);
 	}
 }