Commit 9cd6353c authored by Sebastian Ramacher's avatar Sebastian Ramacher

Save some allocations

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 9514ee4e
......@@ -194,9 +194,7 @@ cmd_info(girara_session_t* session, girara_list_t* UNUSED(argument_list))
if (entry != NULL) {
for (unsigned int i = 0; i < LENGTH(meta_fields); i++) {
if (meta_fields[i].field == entry->type) {
char* text = g_strdup_printf("<b>%s:</b> %s\n", meta_fields[i].name, entry->value);
g_string_append(string, text);
g_free(text);
g_string_append_printf(string, "<b>%s:</b> %s\n", meta_fields[i].name, entry->value);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment