aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/icedteanp/IcedTeaNPPlugin.cc
diff options
context:
space:
mode:
authorAdam Domurad <[email protected]>2012-11-21 10:54:55 -0500
committerAdam Domurad <[email protected]>2012-11-21 10:54:55 -0500
commit86bfc5f740524bdd7f341f9e1b90e39369ad7e8f (patch)
tree8b2978e13b8593ebd8d7b72e9273a37649ead1cd /plugin/icedteanp/IcedTeaNPPlugin.cc
parent6367d0ec6667a4da52e8b5cc05ae83bed23b8adf (diff)
Free two memory leaks
Diffstat (limited to 'plugin/icedteanp/IcedTeaNPPlugin.cc')
-rw-r--r--plugin/icedteanp/IcedTeaNPPlugin.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc
index d7c16d8..302e791 100644
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc
@@ -1210,7 +1210,7 @@ void consume_plugin_message(gchar* message) {
gchar** parts = g_strsplit (message, " ", 5);
if (g_str_has_prefix(parts[1], "PluginProxyInfo"))
{
- gchar* proxy;
+ gchar* proxy = NULL;
uint32_t len;
gchar* decoded_url = (gchar*) calloc(strlen(parts[4]) + 1, sizeof(gchar));
@@ -1220,7 +1220,7 @@ void consume_plugin_message(gchar* message) {
gchar* proxy_info;
#if MOZILLA_VERSION_COLLAPSED < 1090100
- proxy = (char*) malloc(sizeof(char)*2048);
+ proxy = (gchar*) g_malloc(sizeof(char)*2048);
#endif
proxy_info = g_strconcat ("plugin PluginProxyInfo reference ", parts[3], " ", NULL);
@@ -1237,10 +1237,8 @@ void consume_plugin_message(gchar* message) {
g_free(proxy_info);
proxy_info = NULL;
-#if MOZILLA_VERSION_COLLAPSED < 1090100
g_free(proxy);
proxy = NULL;
-#endif
} else if (g_str_has_prefix(parts[1], "PluginCookieInfo"))
{
@@ -1248,7 +1246,7 @@ void consume_plugin_message(gchar* message) {
IcedTeaPluginUtilities::decodeURL(parts[4], &decoded_url);
gchar* cookie_info = g_strconcat ("plugin PluginCookieInfo reference ", parts[3], " ", NULL);
- gchar* cookie_string;
+ gchar* cookie_string = NULL;
uint32_t len;
if (get_cookie_info(decoded_url, &cookie_string, &len) == NPERR_NO_ERROR)
{
@@ -1262,6 +1260,8 @@ void consume_plugin_message(gchar* message) {
decoded_url = NULL;
g_free(cookie_info);
cookie_info = NULL;
+ g_free(cookie_string);
+ cookie_string = NULL;
} else if (g_str_has_prefix(parts[1], "PluginSetCookie"))
{
// Message structure: plugin PluginSetCookie reference -1 <url> <cookie>