On 2023/01/12 0:30, Tao Liu wrote:
>> @@ -275,6 +283,49 @@ static void do_mt_entry(ulong entry,
ulong min, ulong max, uint depth,
>>
>> if (!td)
>> return;
>> +
>> + if (!td->count && td->structname_args) {
>> + /*
>> + * Retrieve all members' info only once (count == 0)
>> + * After last iteration all memory will be freed up
>> + */
>> + e = (struct req_entry **)GETBUF(sizeof(*e) *
td->structname_args);
>
>
> I would suggest freeing the allocated memory for "e" at the end of this
function.
I think free "e" at the end of the function is reasonable. By a quick
glimpse, it seems that do_xarray_entry() and do_rdtree_entry() etc.
have the similar issue?
Ah yes, they have. But all buffers allocated by GETBUF() are
automatically freed after finishing a command, so it's not an actual
problem if you don't use more buffers than the limitation (about 2000+).
So there is no big necessity to fix them alone in this case IMHO.
>
> Can you help to add the FREEBUF() as below? Kazu.
> + if (e)
> + FREEBUF(e);
Sure, I'll do that. Please wait for a while.
>
> Other changes look good to me, for the v5 with the minor modification: Ack.
Also thank you for your effective reviews, Lianbo.
Thanks,
Kazu