Hi,

On Sat, 29 Mar 2014, Domingo Alvarez Duarte wrote:

Thanks for pointing it and show an example to test !
Now going back to the original problem the original tcc implementation leaks
memory on:
----
void *__va_copy(struct __va_list_struct *src)
{
    struct __va_list_struct *dest =
        (struct __va_list_struct *)malloc(sizeof(struct __va_list_struct));
    *dest = *src;
    return dest;
}
----

No, that's not leaking memory, because a va_copy _must_ be paired with a va_end call in client code. And that one will release the allocated memory.

And I'll continue investigating a way to make it work with fossil-scm for the X86_64, the problem that I saw is that there is a double free when the process fork somehow the fossil compiled by tcc seem to not duplicate the malloced strioneng and both the parent and child free the same string.

That's no double free, because the process space will be unshared after fork. I don't know what tool you used that pointed out a double free in this specific situation, but if it really thought this situation is a double free then it's buggy.


Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to