From: Po Lu Date: Sat, 13 Nov 2021 05:02:09 +0000 (+0800) Subject: Prevent NULL-pointer dereference on xwidget callback error X-Git-Tag: emacs-29.0.90~3668^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a5008352c43cda13b0a35547ee91f0c889d71d06;p=emacs.git Prevent NULL-pointer dereference on xwidget callback error * src/xwidget.c (webkit_javascript_finished_cb): Check if `error' is NULL before freeing it. --- 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; }