Re: [evolution-patches] fix for a crash in connector [exchange]



On Wed, 2006-02-22 at 15:06 +0530, Harish Krishnaswamy wrote:
On Wed, 2006-02-22 at 14:09 +0530, pchenthill wrote:
> Hi harish,
>  

> We are trying to access a freed memory location which causes the
> crash.

I see your point on what causes the crash but not so sure about the fix.

while () {

          unref - removed here <<<<<
}

and moved out of the loop  - implies potentially you may be leaking as
you would only free the last value of folder regardless of the number of
iterations on the while loop. 

If indeed it can get executed more than once - you then need to ref it
while adding to the list and unref after use, while retaining the unref
already present in the code (which holds good for all folders whether or
not they might end up in the list).

I am not too familiar with this code...but just curious that this is a
recursive function with a return value, that is never used (not even on
termination).
Yes your right.  Re-looking at the code there , i think there is some more work to be done. exchange_hierarchy_new_folder (hier, folder); emits a signal for the newly created folder. All the other handlers also should ref them. Its really unsafe to unref it here before making sure whether all the handlers ref the folder and can cause a crash in any of the handlers which uses it. Now the fix should go in other parts as well including the issue pointed by you :) 

thanks, Chenthill.

Thanks,
Harish



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