From 2d1b9fddc651866706a1f55957803d51f6476915 Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Wed, 8 Mar 2017 15:46:39 -0500 Subject: [PATCH] CHANGED: Slight performance tweak --- Sources/libMultiMarkdown/writer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/libMultiMarkdown/writer.c b/Sources/libMultiMarkdown/writer.c index b78f8ba..ae76e4d 100644 --- a/Sources/libMultiMarkdown/writer.c +++ b/Sources/libMultiMarkdown/writer.c @@ -1336,15 +1336,16 @@ token * manual_label_from_header(token * h, const char * source) { void process_header_to_links(mmd_engine * e, token * h) { - char * label = label_from_token(e->dstr->str, h); + char * label; // See if we have a manual label token * manual = manual_label_from_header(h, e->dstr->str); if (manual) { - free(label); label = label_from_token(e->dstr->str, manual); h = manual; + } else { + label = label_from_token(e->dstr->str, h); } DString * url = d_string_new("#"); -- 2.40.0