From a5008352c43cda13b0a35547ee91f0c889d71d06 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 13 Nov 2021 13:02:09 +0800 Subject: [PATCH] Prevent NULL-pointer dereference on xwidget callback error * src/xwidget.c (webkit_javascript_finished_cb): Check if `error' is NULL before freeing it. --- src/xwidget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xwidget.c b/src/xwidget.c index fad07efb294..e5a5d9008d5 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -1363,8 +1363,8 @@ webkit_javascript_finished_cb (GObject *webview, if (!js_result) { - g_warning ("Error running javascript: %s", error->message); - g_error_free (error); + if (error) + g_error_free (error); return; } -- 2.39.2