summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--weston-ivi-shell/src/ivi-controller-impl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-controller-impl.c
index 5fa78aa..15e677e 100644
--- a/weston-ivi-shell/src/ivi-controller-impl.c
+++ b/weston-ivi-shell/src/ivi-controller-impl.c
@@ -917,7 +917,7 @@ controller_screen_screenshot(struct wl_client *client,
return;
}
- l->filename = malloc(strlen(filename));
+ l->filename = strdup(filename);
if(l->filename == NULL) {
fprintf(stderr, "fails to allocate memory\n");
free(l);
@@ -925,7 +925,6 @@ controller_screen_screenshot(struct wl_client *client,
}
output = ivi_extension_screen_get_output(iviscrn->shell, iviscrn->layout_screen);
- strcpy(l->filename, filename);
l->listener.notify = controller_screenshot_notify;
wl_signal_add(&output->frame_signal, &l->listener);
output->disable_planes++;