mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
(panel_get_field_by_title): fix memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
917d463d28
commit
e986039142
@ -4694,18 +4694,20 @@ const panel_field_t *
|
|||||||
panel_get_field_by_title (const char *name)
|
panel_get_field_by_title (const char *name)
|
||||||
{
|
{
|
||||||
gsize lc_index;
|
gsize lc_index;
|
||||||
gchar *title = NULL;
|
|
||||||
|
|
||||||
for (lc_index = 0; panel_fields[lc_index].id != NULL; lc_index++)
|
for (lc_index = 0; panel_fields[lc_index].id != NULL; lc_index++)
|
||||||
{
|
{
|
||||||
|
gchar *title;
|
||||||
|
gboolean ok;
|
||||||
|
|
||||||
title = panel_get_title_without_hotkey (panel_fields[lc_index].title_hotkey);
|
title = panel_get_title_without_hotkey (panel_fields[lc_index].title_hotkey);
|
||||||
if (panel_fields[lc_index].title_hotkey != NULL && strcmp (name, title) == 0)
|
ok = title != NULL && strcmp (name, title) == 0;
|
||||||
{
|
g_free (title);
|
||||||
g_free (title);
|
|
||||||
|
if (ok)
|
||||||
return &panel_fields[lc_index];
|
return &panel_fields[lc_index];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
g_free (title);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user