diff options
author | Mario Lang <mlang@debian.org> | 2011-02-21 13:59:16 -0600 |
---|---|---|
committer | Mike Gorse <mgorse@novell.com> | 2011-02-21 13:59:16 -0600 |
commit | b92c3032a60413834b85318e05bc9d0c30f0cefd (patch) | |
tree | eb7f1603dab7d5d381c0d43c33f773bfaac6bd83 /droute/droute.c | |
parent | f8854ff9962b332145a5626b9de0562714b0f4ef (diff) | |
download | at-spi2-atk-b92c3032a60413834b85318e05bc9d0c30f0cefd.tar.gz |
Fix some memory leaks, initialize a variable, and add a NULL check
Diffstat (limited to 'droute/droute.c')
-rw-r--r-- | droute/droute.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/droute/droute.c b/droute/droute.c index ec53ffa..b58402c 100644 --- a/droute/droute.c +++ b/droute/droute.c @@ -380,9 +380,12 @@ handle_dbus (DBusConnection *bus, char *id_str = (char *) g_malloc(40); DBusMessage *reply; - if (strcmp (iface, DBUS_INTERFACE_DBUS) != 0 || - strcmp (member, "Hello") != 0) - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + if (strcmp (iface, DBUS_INTERFACE_DBUS) != 0 || + strcmp (member, "Hello") != 0) + { + g_free (id_str); + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + } /* TODO: Fix this hack (we don't handle wrap-around, for instance) */ sprintf (id_str, ":1.%d", id++); @@ -403,7 +406,7 @@ handle_properties (DBusConnection *bus, const gchar *member, const gchar *pathstr) { - DBusMessage *reply; + DBusMessage *reply = NULL; DBusHandlerResult result = DBUS_HANDLER_RESULT_HANDLED; if (!g_strcmp0(member, "GetAll")) |