screen-share: don't get weston_config object before zalloc

we don't need to get the weston_config object before zalloc success.
dev
Jimmy Ohn 4 years ago
parent a12ba0b30a
commit e55c86a167
  1. 4
      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, "");

Loading…
Cancel
Save