Skip to content

Commit

Permalink
[dbus] Do assign fallback mode correctly to avoid corruption
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Sep 16, 2014
1 parent c01a830 commit 9706a06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/usb_moded-dbus.c
Expand Up @@ -78,10 +78,9 @@ static DBusHandlerResult msg_handler(DBusConnection *const connection, DBusMessa

/* To the outside we want to keep CHARGING and CHARGING_FALLBACK the same */
if(!strcmp(MODE_CHARGING_FALLBACK, mode))
mode = strdup(MODE_CHARGING);
mode = MODE_CHARGING;
if((reply = dbus_message_new_method_return(msg)))
dbus_message_append_args (reply, DBUS_TYPE_STRING, &mode, DBUS_TYPE_INVALID);
free((void *)mode);
}
else if(!strcmp(member, USB_MODE_STATE_SET))
{
Expand Down

0 comments on commit 9706a06

Please sign in to comment.