Re: [evolution-patches] gal, accessiblity, etable, handle the columns change (add/delete/reorder)



On Mon, 2003-11-24 at 00:25, Yuedong Du wrote:

> The patch fix bug 49594.
> +static void
> +eti_header_structure_changed (ETableHeader *eth, AtkObject *a11y)
> +{
> +                                                                                
<snip>                                     
> +        /* Init to ETI_HEADER_UNCHANGED. */
> +        state = g_malloc0 (sizeof (gint) * n_cols);
> +        prev_state = g_malloc0 (sizeof (gint) * prev_n_cols);
> +        reorder = g_malloc0 (sizeof (gint) * n_cols);
> +	g_return_if_fail (state && reorder && prev_state);

This could possibly leak two of the three blocks, although if mallocs
are failing the wheels have already come off.  Also, typically gal uses
g_new0 instead of g_malloc0, but that's not a big deal.  If you really
want to guard against malloc failures, you should g_free state,
prev_state, and reorder before returning.

Please commit to trunk with the above change.  Thanks.

-- 
Mike Kestner <mkestner ximian com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]