1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 09:43:13 +02:00

core: fix memory leak in display of empty bar items

This commit is contained in:
Sebastien Helleu
2011-08-25 20:15:55 +02:00
parent 9a299e1ab3
commit 8d20b217d4
2 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -309,7 +309,12 @@ gui_bar_item_get_value (struct t_gui_bar *bar, struct t_gui_window *window,
item_value = (ptr_item->build_callback) (ptr_item->build_callback_data,
ptr_item, window);
}
if (!item_value || !item_value[0])
if (item_value && !item_value[0])
{
free (item_value);
item_value = NULL;
}
if (!item_value)
return NULL;
}