mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-02 11:55:59 +01:00
backend autocreate: fix leak when WLR_BACKENDS is set
Found through static analysis
This commit is contained in:
parent
1940c6bbd9
commit
e5348ad7d3
1 changed files with 3 additions and 0 deletions
|
@ -203,6 +203,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
|
||||||
wlr_log(L_ERROR, "failed to start backend '%s'", name);
|
wlr_log(L_ERROR, "failed to start backend '%s'", name);
|
||||||
wlr_backend_destroy(backend);
|
wlr_backend_destroy(backend);
|
||||||
wlr_session_destroy(session);
|
wlr_session_destroy(session);
|
||||||
|
free(names);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,12 +211,14 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
|
||||||
wlr_log(L_ERROR, "failed to add backend '%s'", name);
|
wlr_log(L_ERROR, "failed to add backend '%s'", name);
|
||||||
wlr_backend_destroy(backend);
|
wlr_backend_destroy(backend);
|
||||||
wlr_session_destroy(session);
|
wlr_session_destroy(session);
|
||||||
|
free(names);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
name = strtok_r(NULL, ",", &saveptr);
|
name = strtok_r(NULL, ",", &saveptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(names);
|
||||||
return backend;
|
return backend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue