From: Fletcher T. Penney Date: Wed, 8 Mar 2017 20:46:39 +0000 (-0500) Subject: CHANGED: Slight performance tweak X-Git-Tag: 6.0.0-b1^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d1b9fddc651866706a1f55957803d51f6476915;p=multimarkdown CHANGED: Slight performance tweak --- 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("#");