Wireshark-dev: Re: [Wireshark-dev] Possible memory leak in ui/gtk/funnel_stat.c:funnel_new_dial
From: Luis EG Ontanon <[email protected]>
Date: Fri, 13 Jul 2012 04:48:19 -0500
the bellow patch should work...
needs to be compiled and  tested...

Index: funnel_stat.c
===================================================================
--- funnel_stat.c	(revision 43689)
+++ funnel_stat.c	(working copy)
@@ -405,14 +405,16 @@
     window_destroy(GTK_WIDGET(dd->win));

     g_ptr_array_free(returns,FALSE);
+    g_free(dd);

     return TRUE;
 }

 static void funnel_cancel_btn_cb(GtkWidget *bt _U_, gpointer data) {
-    GtkWidget* win = data;
+    struct _funnel_dlg_data* dd = data;

-    window_destroy(GTK_WIDGET(win));
+    window_destroy(GTK_WIDGET(dd->win));
+    g_free(dd);
 }

 static void funnel_new_dialog(const gchar* title,
@@ -467,7 +469,7 @@
     gtk_widget_grab_default(bt_ok);

     bt_cancel = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
-    g_signal_connect(bt_cancel, "clicked",
G_CALLBACK(funnel_cancel_btn_cb), win);
+    g_signal_connect(bt_cancel, "clicked",
G_CALLBACK(funnel_cancel_btn_cb), dd);
     gtk_widget_grab_default(bt_cancel);

     gtk_widget_show(main_tb);


On Thu, Jul 12, 2012 at 11:19 PM, Richard Sharpe
<[email protected]> wrote:
> Hi folks,
>
> In funnel_new_dlg we allocate a structure:
>
>     struct _funnel_dlg_data* dd = g_malloc(sizeof(struct _funnel_dlg_data));
>
> However, we never seem to free it.
>
> --
> Regards,
> Richard Sharpe
> (何以解憂?唯有杜康。--曹操)
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <[email protected]>
> Archives:    http://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>              mailto:wiresh[email protected]?subject=unsubscribe



-- 
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan