summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-16 23:00:58 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-16 23:00:58 -0800
commitc507d164f5856779d23ef030c2a656391707a5ac (patch)
treedddec1cf74a73a287ef3ed368cd644e3e9b0d1f3 /src
parent43a607c5aec4bd8d10486861bf2bc627f8846753 (diff)
Free the string returned by html renderer in main program.
Diffstat (limited to 'src')
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 8f04deb..4340d76 100644
--- 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);
}
}