[totem/gallery-parameters-fix] screenshot: fix invalid free created by the previous change



commit 7c6c7fed195526c6008c57de533af5cd6c5ce25c
Author: Sebastien Bacher <seb128 ubuntu com>
Date:   Thu Oct 25 16:06:41 2018 +0200

    screenshot: fix invalid free created by the previous change
    
    The argv length is static and there is a custom loop to free parameter
    which needs to have its index updated

 src/plugins/screenshot/totem-gallery.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/screenshot/totem-gallery.c b/src/plugins/screenshot/totem-gallery.c
index 6583096e..d9051651 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) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]