diff options
author | William Jon McCann <jmccann@redhat.com> | 2012-09-14 11:18:53 -0400 |
---|---|---|
committer | William Jon McCann <jmccann@redhat.com> | 2012-09-14 12:18:50 -0400 |
commit | a7131e2fd668d7c6bf653d721bb0db052fc27393 (patch) | |
tree | f36c970337cc44ab15d36d1f6824bf8844c2d4ca /dbind | |
parent | 35e3205bf55c3c818524dcb009dae41620b57e96 (diff) | |
download | at-spi2-core-a7131e2fd668d7c6bf653d721bb0db052fc27393.tar.gz |
Don't leak errors
https://bugzilla.gnome.org/show_bug.cgi?id=684033
Diffstat (limited to 'dbind')
-rw-r--r-- | dbind/dbind.c | 14 | ||||
-rw-r--r-- | dbind/dbtest.c | 5 |
2 files changed, 9 insertions, 10 deletions
diff --git a/dbind/dbind.c b/dbind/dbind.c index f216c52a..a463308e 100644 --- a/dbind/dbind.c +++ b/dbind/dbind.c @@ -123,11 +123,12 @@ dbind_method_call_reentrant_va (DBusConnection *cnx, const char *p; va_list args_demarshal; + dbus_error_init (&real_err); + va_copy (args_demarshal, args); if (opt_error) err = opt_error; else { - dbus_error_init (&real_err); err = &real_err; } @@ -176,8 +177,8 @@ out: if (reply) dbus_message_unref (reply); - if (err == &real_err) - dbus_error_free (err); + if (dbus_error_is_set (&real_err)) + dbus_error_free (&real_err); va_end (args_demarshal); return success; @@ -244,10 +245,11 @@ dbind_emit_signal_va (DBusConnection *cnx, DBusError *err, real_err; const char *p; + dbus_error_init (&real_err); + if (opt_error) err = opt_error; else { - dbus_error_init (&real_err); err = &real_err; } @@ -268,8 +270,8 @@ out: if (msg) dbus_message_unref (msg); - if (err == &real_err) - dbus_error_free (err); + if (dbus_error_is_set (&real_err)) + dbus_error_free (&real_err); return success; } diff --git a/dbind/dbtest.c b/dbind/dbtest.c index e8bbb63a..abd241a1 100644 --- a/dbind/dbtest.c +++ b/dbind/dbtest.c @@ -409,11 +409,8 @@ void test_helpers () int main (int argc, char **argv) { DBusConnection *bus; - DBusError err; - dbus_error_init (&err); - - bus = dbus_bus_get (DBUS_BUS_SESSION, &err); + bus = dbus_bus_get (DBUS_BUS_SESSION, NULL); test_helpers (); test_marshalling (); |