]> git.eshelyaron.com Git - emacs.git/commitdiff
Prevent NULL-pointer dereference on xwidget callback error
authorPo Lu <luangruo@yahoo.com>
Sat, 13 Nov 2021 05:02:09 +0000 (13:02 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 13 Nov 2021 05:02:09 +0000 (13:02 +0800)
* src/xwidget.c (webkit_javascript_finished_cb): Check if
`error' is NULL before freeing it.

src/xwidget.c

index fad07efb2947917448bc4808ccba6615b9c19b3a..e5a5d9008d59e58b1750a991d43a194753808269 100644 (file)
@@ -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;
     }