screen-share: don't get weston_config object before zalloc
we don't need to get the weston_config object before zalloc success.
This commit is contained in:
@@ -1163,7 +1163,7 @@ wet_module_init(struct weston_compositor *compositor,
|
|||||||
int *argc, char *argv[])
|
int *argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct screen_share *ss;
|
struct screen_share *ss;
|
||||||
struct weston_config *config = wet_get_config(compositor);
|
struct weston_config *config;
|
||||||
struct weston_config_section *section;
|
struct weston_config_section *section;
|
||||||
|
|
||||||
ss = zalloc(sizeof *ss);
|
ss = zalloc(sizeof *ss);
|
||||||
@@ -1171,6 +1171,8 @@ wet_module_init(struct weston_compositor *compositor,
|
|||||||
return -1;
|
return -1;
|
||||||
ss->compositor = compositor;
|
ss->compositor = compositor;
|
||||||
|
|
||||||
|
config = wet_get_config(compositor);
|
||||||
|
|
||||||
section = weston_config_get_section(config, "screen-share", NULL, NULL);
|
section = weston_config_get_section(config, "screen-share", NULL, NULL);
|
||||||
|
|
||||||
weston_config_section_get_string(section, "command", &ss->command, "");
|
weston_config_section_get_string(section, "command", &ss->command, "");
|
||||||
|
|||||||
Reference in New Issue
Block a user