Re: [Evolution-hackers] camel_mbox_folder_get_full_path equivalent?



On Fri, 2005-07-29 at 14:18 +0200, smurfd wrote:
> > > mail_save_messages(data->folder, data->uids, (void
> > > *)camel_mbox_folder_get_full_path(NULL, g_strdup_printf("%s/",
> > > data->path), info->full_name), NULL, NULL)
> > 
> > Hmm, that leaks 2 strings ...
> 
> Okey, so just to get this straight. You mean, that the
> g_strdup_printf() leaks one string, and that
> camel_mbox_folder_get_full_path() leaks one? Right?

> I just wanna be sure. thats why i ask.

Yeah.  Generally most reasonably api's take a 'const char *', which
generally means it is not re-used outside of the function; i.e. copied
if it needs to be.  const char *'s are never freed anyway.  But as a
result it means that anything that allocates a string has to free it.
 





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