[epiphany] Fix leak in ephy_user_agent_get_internal
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Fix leak in ephy_user_agent_get_internal
- Date: Sun, 24 Jun 2018 21:08:13 +0000 (UTC)
commit 35447e148d69bb5b2349099b3cb1f599c7008f11
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Jun 24 16:06:24 2018 -0500
Fix leak in ephy_user_agent_get_internal
If it returns a nonnull, zero-length string, then we leak it.
lib/ephy-user-agent.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/lib/ephy-user-agent.c b/lib/ephy-user-agent.c
index 7274db04e..7bcf6f50d 100644
--- a/lib/ephy-user-agent.c
+++ b/lib/ephy-user-agent.c
@@ -35,8 +35,11 @@ ephy_user_agent_get_internal (void)
return user_agent;
user_agent = g_settings_get_string (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_USER_AGENT);
- if (user_agent && user_agent[0])
- return user_agent;
+ if (user_agent) {
+ if (user_agent[0])
+ return user_agent;
+ g_free (user_agent);
+ }
settings = webkit_settings_new ();
user_agent = g_strdup_printf ("%s Epiphany/605.1.15", webkit_settings_get_user_agent (settings));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]