diff options
author | Adam Domurad <[email protected]> | 2012-07-09 14:50:22 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2012-07-09 14:50:22 -0400 |
commit | 05c526199a8603d6f06e243484da9aad7b5ac1db (patch) | |
tree | f2f3374a89a3d5679651f75e1ee2a79822074c34 /plugin | |
parent | 355abc7f193eec3e8e54ffcba720818b9be2aa4d (diff) |
Small fixes to C++ side of plugin, submitted by Martin Olsson.
Also fixed a space in my last ChangeLog.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/icedteanp/IcedTeaNPPlugin.cc | 4 | ||||
-rw-r--r-- | plugin/icedteanp/IcedTeaPluginRequestProcessor.cc | 4 | ||||
-rw-r--r-- | plugin/icedteanp/IcedTeaPluginUtils.cc | 11 |
3 files changed, 10 insertions, 9 deletions
diff --git a/plugin/icedteanp/IcedTeaNPPlugin.cc b/plugin/icedteanp/IcedTeaNPPlugin.cc index 810e383..eb6d4ec 100644 --- a/plugin/icedteanp/IcedTeaNPPlugin.cc +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc @@ -1272,7 +1272,7 @@ void consume_message(gchar* message) { PLUGIN_DEBUG("Proxy info: %s\n", proxy_info); plugin_send_message_to_appletviewer(proxy_info); - g_free(decoded_url); + free(decoded_url); decoded_url = NULL; g_free(proxy_info); proxy_info = NULL; @@ -1298,7 +1298,7 @@ void consume_message(gchar* message) { PLUGIN_DEBUG("Cookie info: %s\n", cookie_info); plugin_send_message_to_appletviewer(cookie_info); - g_free(decoded_url); + free(decoded_url); decoded_url = NULL; g_free(cookie_info); cookie_info = NULL; diff --git a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc index 6505333..ef23186 100644 --- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc +++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc @@ -275,7 +275,7 @@ PluginRequestProcessor::call(std::vector<std::string*>* message_parts) JavaResultData* java_result; NPVariant* result_variant; std::string result_variant_jniid = std::string(); - NPVariant* args_array; + NPVariant* args_array = NULL; AsyncCallThreadData thread_data = AsyncCallThreadData(); reference = atoi(message_parts->at(3)->c_str()); @@ -994,7 +994,7 @@ _loadURL(void* data) { ((AsyncCallThreadData*) data)->result_ready = true; - g_free(decoded_url); + free(decoded_url); decoded_url = NULL; PLUGIN_DEBUG("_loadURL returning %d\n", ((AsyncCallThreadData*) data)->call_successful); diff --git a/plugin/icedteanp/IcedTeaPluginUtils.cc b/plugin/icedteanp/IcedTeaPluginUtils.cc index c57277c..c9fbc1a 100644 --- a/plugin/icedteanp/IcedTeaPluginUtils.cc +++ b/plugin/icedteanp/IcedTeaPluginUtils.cc @@ -297,7 +297,7 @@ IcedTeaPluginUtilities::strSplit(const char* str, const char* delim) v->reserve(strlen(str)/2); char* copy; - // Tokening is done on a copy + // Tokenization is done on a copy copy = (char*) malloc (sizeof(char)*strlen(str) + 1); strcpy(copy, str); @@ -308,11 +308,12 @@ IcedTeaPluginUtilities::strSplit(const char* str, const char* delim) { // Allocation on heap since caller has no way to knowing how much will // be needed. Make sure caller cleans up! - std::string* s = new std::string(); - s->append(tok_ptr); - v->push_back(s); - tok_ptr = strtok (NULL, " "); + std::string* s = new std::string(); + s->append(tok_ptr); + v->push_back(s); + tok_ptr = strtok (NULL, " "); } + free(copy); return v; } |