Garbage out values on error in GLib bindings
@ross
Submitted by Ross Burton Assigned to D-Bus Maintainers
Description
If I have a server method that returns a string or an error, and I call it async with the glib bindings, the callback signature looks like this:
static void foo_reply (DBusGProxy *proxy, char *string, GError *error, gpointer user_data);
If an error was returned the string argument isn't initialised so garbage is returned. I'd expect NULL to be returned for unset values, as this means I can't simply do:
if (string) g_free (string);
I have to check if error is set instead.