[gtk/wip/baedert/for-master: 93/101] label: Plug a potential memory leak




commit 3cbe1b3146f6f201c10ffff089814d8ebf18f3ab
Author: Timm Bäder <mail baedert org>
Date:   Thu Oct 15 06:06:43 2020 +0200

    label: Plug a potential memory leak
    
    This only happens in error cases so pretty insignificant.
    
    Found by scan-build

 gtk/gtklabel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index d23f0253a9..b77a220450 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -2334,7 +2334,10 @@ no_uline:
           char *text_for_accel;
 
           if (!pango_parse_markup (str_for_display, -1, 0, NULL, &text_for_accel, NULL, &error))
-            goto error_set;
+            {
+              g_free (new_text);
+              goto error_set;
+            }
 
           extract_mnemonic_keyval (text_for_accel,
                                    NULL,


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