Re: [evolution-patches] patch to fix problems with folder name (camel-groupwise)



This leaks memory:

On Mon, 2005-07-11 at 00:31 -0600, Jain Vivek wrote:
> -       }
> +
> +       container_id =  g_strdup (g_hash_table_lookup
> (priv->name_hash, g_strdup(folder_name))) ;
>   

This leaks memory:

> +       if (parent_name) {
> +               if (strlen(parent_name) > 0) 
> +                       fi->full_name =
> g_strconcat(parent_name,"/",g_strdup(folder_name), NULL) ;
> 

And surprise, so does this:

> -       } else
> +       if (parent_name && (strlen(parent_name) > 0) ) 
> +               parent_id = g_hash_table_lookup (priv->name_hash,
> g_strdup(parent_name)) ;
> +       else
>                 parent_id = "" ;

Sigh, and another one:

> +       g_hash_table_remove (priv->name_hash, g_strdup(old_name)) ;


Yes, it leaked it before your patch, but it should be obvious to spot
the problems when transcribing existing code.





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