From f5e0385973e68ec19f28322fb2cb1768a0e6cf71 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Thu, 12 Oct 2017 01:58:47 -0400 Subject: 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). --- (limited to 'src') 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:")) { -- cgit v0.9.1