Re: Review request: tny_camel_header_dup_message_id does not allocate message ID



Alexander Chumakov escribiu:
> 2) Fix information:
> The clients expect that the calls
> tny_camel_header_dup_message_id/tny_header_dup_message_id return an
> allocated content, but tinymail returns the pointer to the local data.
> This makes it possible that the data is released 2 times: by the client
> with g_free and internally in tinymail. This may result in a crash or
> memory corruption.
> One more reason for allocation of the result is that tinymain has a
> number of other xxx_header_dup_xxx methods and all they return allocated
> results.

You don't need to perform the g_new stuff. Just assign to retval the
result of g_strdup the value returned by camel.

Br


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