summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Ohn <yongjin.ohn@lge.com>2020-07-01 18:54:12 +0900
committerJimmy Ohn <yongjin.ohn@lge.com>2020-07-01 18:58:38 +0900
commite55c86a16751f58577195cf76ec7f5c6a106f3bd (patch)
tree1b5af1063da0d35c70a0c80d7c6ad6e4ee0a4687
parenta12ba0b30a911d57d3d564298a149a03aa7f2592 (diff)
downloadweston-e55c86a16751f58577195cf76ec7f5c6a106f3bd.tar.gz
screen-share: don't get weston_config object before zalloc
we don't need to get the weston_config object before zalloc success.
-rw-r--r--compositor/screen-share.c4
1 files changed, 3 insertions, 1 deletions
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, "");