[gnome-panel] run-dialog: fix memory leak defect



commit e6043676229af4c83a4ee6ba5b78437e3a043671
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Mar 3 13:52:23 2022 +0200

    run-dialog: fix memory leak defect
    
    This is false postive defect as g_locale_from_utf8 returns NULL
    on error.
    
    Coverity CID: #1514684

 gnome-panel/panel-run-dialog.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index 0229e2405..bea153a66 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -522,7 +522,7 @@ panel_run_dialog_execute (PanelRunDialog *dialog)
        error = NULL;
        disk = g_locale_from_utf8 (command, -1, NULL, NULL, &error);
 
-       if (!disk || error) {
+       if (error != NULL) {
                char *primary;
 
                primary = g_strdup_printf (_("Could not convert '%s' from UTF-8"),
@@ -534,6 +534,7 @@ panel_run_dialog_execute (PanelRunDialog *dialog)
 
                g_error_free (error);
                g_free (command);
+               g_free (disk);
                return;
        }
 


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