Ethereal-dev: Re: [Ethereal-dev] Problems with "Save Highlighted Data..."

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Richard Sharpe <rsharpe@xxxxxxxxxxxxxxxxx>
Date: Wed, 17 Dec 2003 17:04:58 -0800 (PST)
On Wed, 17 Dec 2003, [UTF-8] Kai Krüger wrote:

> Hello,
> 
> I was trying to use the "Save Highlighted Data..." feature using todays 
> CVS code, however it didn't write the specified file to disk.  Looking 
> at the source, the problem seems to be in gtk/proto_draw.c in the 
> function savehex_save_clicked_cb(). The file string was always empty, 
> even though a file was specified in the dialog.
> Moving the gtk_wiget_destroy(GTK_WIGET(savehex_dlg)) to the end of the 
> function, after the open() call solved the problem for me. I suspect, 
> that the gtk_wiget_destroy also frees the memory of the file string and 
> the operations on the file string after the call to gtk_wiget_destroy 
> therefore always failed.
> 
> If wanted, I can supply a patch that moves the gtk_wiget_destroy to the 
> end of the function. However as I'm neither familiar with ethereal nor 
> GTK coding (styles) I don't know if this is the correct way to fix the 
> problem

OK, that sounds like the correct fix. Please send the patch.

Regards
-----
Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com