[glib/glib-2-72: 13/39] glib/win32: fix potential leak on spawn error




commit 091e409dee357b69549b5c50c656a17cf601e373
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Thu Apr 7 17:49:36 2022 +0400

    glib/win32: fix potential leak on spawn error
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>
    
    (cherry-picked from commit 982b074fa97bcabc5e7624ac883b035a403f401e)

 glib/gspawn-win32.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/glib/gspawn-win32.c b/glib/gspawn-win32.c
index fc2a96c949..29bdf4d79b 100644
--- a/glib/gspawn-win32.c
+++ b/glib/gspawn-win32.c
@@ -903,7 +903,8 @@ fork_exec (gint                  *exit_status,
                                    0, TRUE, DUPLICATE_SAME_ACCESS))
                {
                  char *emsg = g_win32_error_message (GetLastError ());
-                 g_print("%s\n", emsg);
+                 g_print ("%s\n", emsg);
+                 g_free (emsg);
                  *child_pid = 0;
                }
            }


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