mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-23 18:39:48 +01:00
wlr-output-management: add missing NULL check
Handle allocation failure in wlr_output_configuration_head_v1_create
This commit is contained in:
parent
6485fadc16
commit
78e9e692e8
1 changed files with 3 additions and 0 deletions
|
@ -118,6 +118,9 @@ struct wlr_output_configuration_head_v1 *
|
||||||
struct wlr_output_configuration_v1 *config, struct wlr_output *output) {
|
struct wlr_output_configuration_v1 *config, struct wlr_output *output) {
|
||||||
struct wlr_output_configuration_head_v1 *config_head =
|
struct wlr_output_configuration_head_v1 *config_head =
|
||||||
config_head_create(config, output);
|
config_head_create(config, output);
|
||||||
|
if (config_head == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
config_head->state.enabled = output->enabled;
|
config_head->state.enabled = output->enabled;
|
||||||
config_head->state.mode = output->current_mode;
|
config_head->state.mode = output->current_mode;
|
||||||
config_head->state.custom_mode.width = output->width;
|
config_head->state.custom_mode.width = output->width;
|
||||||
|
|
Loading…
Reference in a new issue