diff --git a/src/notifications.c b/src/notifications.c index 4cb65fb..1507859 100644 --- a/src/notifications.c +++ b/src/notifications.c @@ -67,6 +67,7 @@ char* construct_notification(struct session* ssn, char* construct_notification_action(struct mstdnt_notification* notif, size_t* size) { + char* res; char* display_name = emojify(notif->account->display_name, notif->account->emojis, notif->account->emojis_len); @@ -78,9 +79,10 @@ char* construct_notification_action(struct mstdnt_notification* notif, size_t* s .action = notification_type_compact_str(notif->type), .notif_svg = notification_type_svg(notif->type) }; + res = tmpl_gen_notification_action(&tdata, size); if (display_name != notif->account->display_name) free(display_name); - return tmpl_gen_notification_action(&tdata, size); + return res; } char* construct_notification_compact(struct session* ssn, diff --git a/src/status.c b/src/status.c index bc1f53c..49ff226 100644 --- a/src/status.c +++ b/src/status.c @@ -431,7 +431,7 @@ char* reformat_status(struct session* ssn, if (emos) { emo_res = emojify(res, emos, emos_len); - if (emo_res != content && res != content) + if (emo_res != res && res != content) free(res); res = emo_res; }