]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0210: Motif: leaking memory when mui_mch_dialog() fails v9.1.0210
authorChristian Brabandt <cb@256bit.org>
Tue, 26 Mar 2024 17:44:48 +0000 (18:44 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 26 Mar 2024 17:44:48 +0000 (18:44 +0100)
Problem:  Motif: leaking memory when mui_mch_dialog() fails
          (LuMingYinDetect)
Solution: When allocating the label using the XmStringCreateLtoR()
          function fails, before returning also free the allocated
          buttons pointer.

fixes: #14247
closes: #14280

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/gui_motif.c
src/version.c

index 630082e981308fde6bbf77860d69dead57de9cf7..ed721b52d0c7f804cb13c5cc989b8055f5dd6c4f 100644 (file)
@@ -2732,7 +2732,10 @@ gui_mch_dialog(
     // Motif.
     label = XmStringCreateLtoR((char *)message, STRING_TAG);
     if (label == NULL)
+    {
+       vim_free(buttons);
        return -1;
+    }
     w = XtVaCreateManagedWidget("dialogMessage",
                                xmLabelGadgetClass, form,
                                XmNlabelString, label,
index 2061fec42e75944714a5d15a260b317fdaffdb83..0c053c565843568f15cc2c38041274fb048ee560 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    210,
 /**/
     209,
 /**/