]> granicus.if.org Git - multimarkdown/commitdiff
CHANGED: Slight performance tweak
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 8 Mar 2017 20:46:39 +0000 (15:46 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Wed, 8 Mar 2017 20:46:39 +0000 (15:46 -0500)
Sources/libMultiMarkdown/writer.c

index b78f8baef4be111939997fd37d9842961b46dc64..ae76e4d4a143a612d5d14de3dc3b7a98cd653c4c 100644 (file)
@@ -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("#");