[Freeciv-Dev] Re: (PR#13461) Improve sanity of logging
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13461 >
Per I. Mathisen wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=13461 >
>
> On Tue, 12 Jul 2005, Jason Short wrote:
>
>>This isn't enough I think since current strings may already be strdup'd
>>by the caller.To avoid leaks the caller's strdup needs to be dropped
>>(unless the caller uses static memory).
>
>
> Ehm, but that is surely outside the scope of my patch? If there is memory
> leak in the calling code, then that is a separate problem, and this patch
> changes nothing in that regard?
No because currently the calling code has to do a strdup of the string
before passing it in to the log function, whereas under your path the
calling code isn't supposed to do a strdup.
BTW another fix would be to leave the log code as it is and just add the
strdup to the calling code wherever the bug shows up. But this isn't
really as good.
-jason
|
|