[Dovecot] Creating and interacting with array inside plugin

Alex Baule alexwbaule at gmail.com
Fri Feb 24 04:32:47 EET 2012


Tks Timo...



Em 23 de fevereiro de 2012 21:34, Timo Sirainen <tss at iki.fi> escreveu:
> On 23.2.2012, at 18.19, Alex Baule wrote:
>
>> ok, inside my expunged rewrite function i create the array like quota
>> does, and append it to my array.
>>
>> struct emexis_ids_x_uis append_uis;
>> append_uis.ids = _mail->uid;
>> append_uis.uis_file = bodyFile;
> ..
>> But when i do a foreach in this Array, my ids is OK, but my uis_file
>> has tha same value every time (the value is the lasted value
>> inserted).
>
> I guess the memory isn't permanently allocated for it, so you need to do:
>
> append_uis.uis_file = i_strdup(bodyFile);
>
> Note that you'll also need to later i_free() it to avoid leaking memory.
>



More information about the dovecot mailing list