Citeren Arjen de Korte <[email protected]>:
Author: adkorte-guest
Date: Fri Feb 19 13:22:12 2010
New Revision: 2360
URL: http://boxster.ghz.cc/projects/nut/changeset/2360
Log:
You can't compare strings with '!=' in C, so the logic to determine
if the stock message was overridden was flawed (causing problems
with (de)allocation of memory)
Modified:
trunk/clients/upsmon.c
trunk/clients/upsmon.h
The above isn't true if we only compare if we only look if the pointer
address we assigned previously hasn't changed (and this is what we did
before).
Nevertheless, I really dislike the prior way of checking for changes
and would rather see that pointers that are used for dynamic memory
are initialized to NULL and free'd unconditionally before allocating
memory to them. This makes it much easier to prevent leaking memory.
Best regards, Arjen
--
Please keep list traffic on the list
_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev