[PATCH] fix DBusError leaking libhal and libhal-storage

Danny Kukawka danny.kukawka at web.de
Sat Jul 22 12:51:44 PDT 2006


On Saturday 22 July 2006 17:08, David Zeuthen wrote:
> So, how about making
[...]
> complain to stderr if this macro is used but the error isn't set? I mean
> we only should be using the macro if we know the error is set. With that
> it looks good to me.

Only to understand correct: you want to print a message to the log if the 
macro is used but the error is not set?

I don't see a problem to use the macro also if the error is not set, because 
dbus_error_is_set() check if the error is set. This is IMO better than a 
memory leak which cost much more than the check.

There are also two other possible solutions:
1.) return the error (via a additional pointer as parameter)
2.) use NULL instead of a DBusError in function calls (currently there is no 
information returned to the caller and we also not print any debug message 
from the error)

Danny


More information about the hal mailing list