diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-12 01:58:47 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-12 02:00:22 (EDT) |
commit | f5e0385973e68ec19f28322fb2cb1768a0e6cf71 (patch) | |
tree | 08ee15277e04bb494f43d12a9d8d80e7f8c4bc04 /src | |
parent | f06b54edd30654314be66007eefd985a11781ef4 (diff) | |
download | marquee-f5e0385973e68ec19f28322fb2cb1768a0e6cf71.zip marquee-f5e0385973e68ec19f28322fb2cb1768a0e6cf71.tar.gz marquee-f5e0385973e68ec19f28322fb2cb1768a0e6cf71.tar.bz2 |
mq_web_view_load_uri(): Free uri member before assigning to it
We're checking that it isn't NULL before calling g_free(). g_free()
already does this check, so we don't actually have to do this. But it's
good practice, and it'll save the overhead of unnecessary g_free() calls
(at the expense of extra comparisons and branchings when g_free() needs
to be called).
Diffstat (limited to 'src')
-rw-r--r-- | src/web-view.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/web-view.c b/src/web-view.c index 11d8009..49ffea2 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -702,6 +702,9 @@ mq_web_view_load_uri(MqWebView *web_view, const gchar *uri) return; } + if (web_view->uri) { + g_free(web_view->uri); + } web_view->uri = g_strdup(uri); if (g_str_has_prefix(uri, "about:")) { |