From 9a9e521da8e8cf333368180ac259d244a39dbbae Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 26 Mar 2019 08:57:34 +0300 Subject: [PATCH] winegstreamer: Get rid of allocated arguments array. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/winegstreamer/main.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/winegstreamer/main.c b/dlls/winegstreamer/main.c index a1b1648d9d9..18154fb4239 100644 --- a/dlls/winegstreamer/main.c +++ b/dlls/winegstreamer/main.c @@ -262,7 +262,8 @@ static BOOL CALLBACK init_gstreamer_proc(INIT_ONCE *once, void *param, void **ct BOOL *status = param; char argv0[] = "wine"; char argv1[] = "--gst-disable-registry-fork"; - char **argv = HeapAlloc(GetProcessHeap(), 0, sizeof(char *)*3); + char *args[3]; + char **argv = args; int argc = 2; GError *err = NULL; @@ -272,12 +273,8 @@ static BOOL CALLBACK init_gstreamer_proc(INIT_ONCE *once, void *param, void **ct argv[1] = argv1; argv[2] = NULL; *status = gst_init_check(&argc, &argv, &err); - HeapFree(GetProcessHeap(), 0, argv); - if (err) { - ERR("Failed to initialize gstreamer: %s\n", err->message); - g_error_free(err); - } - if (*status) { + if (*status) + { HINSTANCE newhandle; /* Unloading glib is a bad idea.. it installs atexit handlers, * so never unload the dll after loading */ @@ -288,6 +285,11 @@ static BOOL CALLBACK init_gstreamer_proc(INIT_ONCE *once, void *param, void **ct start_dispatch_thread(); } + else if (err) + { + ERR("Failed to initialize gstreamer: %s\n", debugstr_a(err->message)); + g_error_free(err); + } return TRUE; }