diff --git a/gnome/ChangeLog b/gnome/ChangeLog index c1cbe2305..1f4de1210 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,7 @@ +2000-09-12 Andrew V. Samoilov + + * glayout.c (run_cmd): Memory leak fix: cmd released after use + 2000-08-31 Pavel Roskin * directory-ok.xpm gpopup.c i-device.png image.metadata.in diff --git a/gnome/glayout.c b/gnome/glayout.c index a7baeb6b5..a6ecc1062 100644 --- a/gnome/glayout.c +++ b/gnome/glayout.c @@ -294,14 +294,18 @@ save_panel_types (void) panel_save_setup (pc->panel, pc->panel->panel_name); } } + static void run_cmd (void) { - char *cmd; + char *cmd = _("Enter command to run"); - cmd = input_dialog (_("Enter command to run"), _("Enter command to run"), ""); - if (cmd && *cmd){ - my_system (EXECUTE_AS_SHELL, shell, cmd); + cmd = input_dialog (cmd, cmd, ""); + if (cmd){ + if (*cmd){ + my_system (EXECUTE_AS_SHELL, shell, cmd); + } + g_free (cmd); } } @@ -539,15 +543,14 @@ create_new_menu_from (char *file, GtkWidget *shell, gint pos) g_return_val_if_fail (shell != NULL, pos); + if (shell == NULL){ + return pos; + } + dir = opendir (file); if (dir == NULL) return pos; - if (shell == NULL){ - closedir (dir); - return pos; - } - while ((dirstruc = readdir (dir)) != NULL){ if (dirstruc->d_name[0] == '.') continue;