headless-backend: fix leak of transform configuration
Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> [Pekka: fixed the mispelling in subject] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
4c72e29f99
commit
2da6d0cf69
+7
-3
@@ -693,7 +693,7 @@ load_headless_backend(struct weston_compositor *c, char const * backend,
|
|||||||
{
|
{
|
||||||
struct weston_headless_backend_config config = {{ 0, }};
|
struct weston_headless_backend_config config = {{ 0, }};
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
const char *transform = "normal";
|
char *transform = NULL;
|
||||||
|
|
||||||
config.width = 1024;
|
config.width = 1024;
|
||||||
config.height = 640;
|
config.height = 640;
|
||||||
@@ -707,8 +707,12 @@ load_headless_backend(struct weston_compositor *c, char const * backend,
|
|||||||
|
|
||||||
parse_options(options, ARRAY_LENGTH(options), argc, argv);
|
parse_options(options, ARRAY_LENGTH(options), argc, argv);
|
||||||
|
|
||||||
if (weston_parse_transform(transform, &config.transform) < 0)
|
config.transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
||||||
weston_log("Invalid transform \"%s\"\n", transform);
|
if (transform) {
|
||||||
|
if (weston_parse_transform(transform, &config.transform) < 0)
|
||||||
|
weston_log("Invalid transform \"%s\"\n", transform);
|
||||||
|
free(transform);
|
||||||
|
}
|
||||||
|
|
||||||
config.base.struct_version = WESTON_HEADLESS_BACKEND_CONFIG_VERSION;
|
config.base.struct_version = WESTON_HEADLESS_BACKEND_CONFIG_VERSION;
|
||||||
config.base.struct_size = sizeof(struct weston_headless_backend_config);
|
config.base.struct_size = sizeof(struct weston_headless_backend_config);
|
||||||
|
|||||||
Reference in New Issue
Block a user