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




commit c7dbb8ef91fe9e195055f242b3330b6c658accb5
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 70f9152d5f..2b3ee4c102 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -2337,7 +2337,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]