summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2019-05-20 23:53:59 +0200
committerDaniel Carl <danielcarl@gmx.de>2019-05-20 23:53:59 +0200
commit333496479192bd995b5dce0384c080c2915c3b20 (patch)
tree9c4885996ef495c43f5b4a8ff2266aea8987eed2 /src/util.c
parent3c00e1c8c05d91df5b8dea894107a3e28a0382f8 (diff)
Avoid double free in on_webview_notify_uri #561.
Thank to Valérian Rousset for pointing this out. Also change the until_sanitize_uri function to return given uri in case an error occurred during sanitization process to reduce cases where this function returns NULL.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util.c b/src/util.c
index f2dfee7..4cc50a0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -834,12 +834,12 @@ char *util_sanitize_uri(const char *uri_str)
}
#if WEBKIT_CHECK_VERSION(2, 24, 0)
for_display = webkit_uri_for_display(uri_str);
+ if (!for_display) {
+ for_display = g_strdup(uri_str);
+ }
#else
for_display = g_strdup(uri_str);
#endif
- if (!for_display) {
- return NULL;
- }
/* Sanitize the uri only in case there is a @ which might be the indicator
* for credentials used in uri. */