diff --git a/src/base_page.c b/src/base_page.c index 4013b30..3f27dc2 100644 --- a/src/base_page.c +++ b/src/base_page.c @@ -42,7 +42,7 @@ void render_base_page(struct base_page* page, struct session* ssn, mastodont_t* // Mastodont, used for notifications sidebar struct mstdnt_storage storage = { 0 }; struct mstdnt_notification* notifs = NULL; - size_t notifs_len; + size_t notifs_len = 0; read_config(ssn); diff --git a/src/notifications.c b/src/notifications.c index 0147ba6..6d349f2 100644 --- a/src/notifications.c +++ b/src/notifications.c @@ -90,7 +90,7 @@ char* construct_notification_compact(struct session* ssn, int* size) { char* notif_html; - char* status_format; + char* status_format = NULL; char* notif_stats = NULL; const char* type_str = notification_type_compact_str(notif->type); @@ -106,9 +106,6 @@ char* construct_notification_compact(struct session* ssn, notif->status->emojis, notif->status->emojis_len); } - else { - status_format = NULL; - } size_t s = easprintf(¬if_html, data_notification_compact_html, notif->account->avatar, @@ -127,7 +124,8 @@ char* construct_notification_compact(struct session* ssn, if (size) *size = s; - if (status_format) free(status_format); + if (status_format && + status_format != notif->status->content) free(status_format); if (notif_stats) free(notif_stats); return notif_html; }