From e55c86a16751f58577195cf76ec7f5c6a106f3bd Mon Sep 17 00:00:00 2001 From: Jimmy Ohn Date: Wed, 1 Jul 2020 18:54:12 +0900 Subject: [PATCH] screen-share: don't get weston_config object before zalloc we don't need to get the weston_config object before zalloc success. --- compositor/screen-share.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compositor/screen-share.c b/compositor/screen-share.c index 62b871bf..8c37452d 100644 --- a/compositor/screen-share.c +++ b/compositor/screen-share.c @@ -1163,7 +1163,7 @@ wet_module_init(struct weston_compositor *compositor, int *argc, char *argv[]) { struct screen_share *ss; - struct weston_config *config = wet_get_config(compositor); + struct weston_config *config; struct weston_config_section *section; ss = zalloc(sizeof *ss); @@ -1171,6 +1171,8 @@ wet_module_init(struct weston_compositor *compositor, return -1; ss->compositor = compositor; + config = wet_get_config(compositor); + section = weston_config_get_section(config, "screen-share", NULL, NULL); weston_config_section_get_string(section, "command", &ss->command, "");