From f1bc4e8b9daf04a5cb4b9464021bb9e816eed3ea Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Wed, 17 Mar 2010 14:53:17 -0400 Subject: Fix a series of memory leaks in the SBUS --- src/monitor/monitor_sbus.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/monitor/monitor_sbus.c') diff --git a/src/monitor/monitor_sbus.c b/src/monitor/monitor_sbus.c index eedb60b3b..43e5b685e 100644 --- a/src/monitor/monitor_sbus.c +++ b/src/monitor/monitor_sbus.c @@ -111,6 +111,7 @@ int monitor_common_send_id(struct sbus_connection *conn, { DBusMessage *msg; dbus_bool_t ret; + int retval; /* create the message */ msg = dbus_message_new_method_call(NULL, @@ -133,9 +134,11 @@ int monitor_common_send_id(struct sbus_connection *conn, return EIO; } - return sbus_conn_send(conn, msg, 3000, - id_callback, - NULL, NULL); + retval = sbus_conn_send(conn, msg, 3000, + id_callback, + NULL, NULL); + dbus_message_unref(msg); + return retval; } int monitor_common_pong(DBusMessage *message, -- cgit