Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[systemd] Fix memory leak on systemd_control_service() error path
If dbus_connection_send_with_reply_and_block() should set the
dbus error, it is never freed.

Make sure dbus_error_free() is called before returning from the function.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jul 7, 2016
1 parent de044e2 commit 9555720
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/usb_moded-systemd.c
Expand Up @@ -96,6 +96,7 @@ int systemd_control_service(const char *name, const char *method)
quit:
dbus_connection_close(bus);
dbus_connection_unref(bus);
dbus_error_free(&error);

return(ret);
}

0 comments on commit 9555720

Please sign in to comment.