• spiiroin's avatar
    [trigger] Fix resource leaks · 4a8d5988
    spiiroin authored
    Looks like trigger_udev_sysname variable stays valid only because
    udev_device_new_from_syspath() return value is leaked in trigger_init().
    Take a copy of udev_device_get_sysname() return value instead on relying on
    borrowed string pointer staying valid.
    Remove all mid-function returns, release unneeded resources on success, and
    all acquired resources in case of failure.
    Having a boolean function return false on success / true on failure is
    a bit confusing, so rectify that while at it.
    Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
usb_moded-trigger.h 1.25 KB