diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-11-16 06:54:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-16 06:54:49 -0500 |
commit | 900d9dc05e83dda18086b4cb2f6bcce06ed7b387 (patch) | |
tree | 0f7b541296b28c3ebf14a678483bc8f19296bd24 /backend | |
parent | 57a355a6a778c1b23de8728f407b10cc2e481758 (diff) | |
parent | bb79ada49f43be5417bdd55fda3a7cf07c2a69df (diff) |
Merge pull request #422 from emersion/scan-build-fixes
Fix a bunch of mistakes detected with scan-build
Diffstat (limited to 'backend')
-rw-r--r-- | backend/libinput/events.c | 5 | ||||
-rw-r--r-- | backend/session/session.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c index 5da45c67..3ca41124 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -66,10 +66,11 @@ static void handle_device_added(struct wlr_libinput_backend *backend, int product = libinput_device_get_id_product(libinput_dev); const char *name = libinput_device_get_name(libinput_dev); struct wl_list *wlr_devices = calloc(1, sizeof(struct wl_list)); - wl_list_init(wlr_devices); if (!wlr_devices) { - goto fail; + wlr_log(L_ERROR, "Allocation failed"); + return; } + wl_list_init(wlr_devices); wlr_log(L_DEBUG, "Added %s [%d:%d]", name, vendor, product); if (libinput_device_has_capability(libinput_dev, LIBINPUT_DEVICE_CAP_KEYBOARD)) { diff --git a/backend/session/session.c b/backend/session/session.c index 760830c3..657558fd 100644 --- a/backend/session/session.c +++ b/backend/session/session.c @@ -249,7 +249,7 @@ static size_t explicit_find_gpus(struct wlr_session *session, } } while ((ptr = strtok_r(NULL, ":", &save))); - free(ptr); + free(gpus); return i; } |