summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2018-10-25 16:06:41 +0200
committerSebastien Bacher <seb128@ubuntu.com>2018-10-25 16:06:41 +0200
commit7c6c7fed195526c6008c57de533af5cd6c5ce25c (patch)
treec50a6cb2fd6dcb46cba4dbe901bf20f9a69ed995
parent82d5c88770ed9973f40fc96e2e165ed8ed8a850c (diff)
downloadtotem-gallery-parameters-fix.tar.gz
screenshot: fix invalid free created by the previous changegallery-parameters-fix
The argv length is static and there is a custom loop to free parameter which needs to have its index updated
-rw-r--r--src/plugins/screenshot/totem-gallery.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/screenshot/totem-gallery.c b/src/plugins/screenshot/totem-gallery.c
index 6583096e5..d90516513 100644
--- a/src/plugins/screenshot/totem-gallery.c
+++ b/src/plugins/screenshot/totem-gallery.c
@@ -145,7 +145,7 @@ default_screenshot_count_toggled_callback (GtkToggleButton *toggle_button, Totem
static void
dialog_response_callback (GtkDialog *dialog, gint response_id, TotemGallery *self)
{
- gchar *filename, *video_mrl, *argv[9];
+ gchar *filename, *video_mrl, *argv[6];
guint screenshot_count, i;
gint stdout_fd;
GPid child_pid;
@@ -182,7 +182,7 @@ dialog_response_callback (GtkDialog *dialog, gint response_id, TotemGallery *sel
&child_pid, NULL, &stdout_fd, NULL, &error);
/* Free argv, minus the filename */
- for (i = 4; i < G_N_ELEMENTS (argv) - 2; i++)
+ for (i = 1; i < G_N_ELEMENTS (argv) - 2; i++)
g_free (argv[i]);
if (ret == FALSE) {