Fix memory leak 72/5572/1
authorBaptiste DURAND <baptiste.durand@eurogiciel.fr>
Tue, 9 Jul 2013 11:35:16 +0000 (13:35 +0200)
committerBaptiste DURAND <baptiste.durand@eurogiciel.fr>
Tue, 9 Jul 2013 11:35:16 +0000 (13:35 +0200)
ri_t is a complex structure.
It should be freed by call iri_destroy.
Cast it to a scopedPtr is forbiden because that call a delete function not iri_destroy

packaging/wrt.changes
src/view/webkit/injected-bundle/injected_bundle_uri_handling.cpp

index 5ec5709..ad9db4a 100644 (file)
@@ -1,3 +1,6 @@
+* Tue Jul 09 2013 Baptiste DURAND <baptiste.durand@eurogiciel.fr> accepted/tizen/20130708.234009@378666e
+-  Fix memory leak
+
 * Mon Jul 08 2013 Rusty Lynch <rusty.lynch@intel.com> submit/tizen/20130627.212436@1351791
 - Refactor spec handling of decrypt support
 - Return an error when we try to load an encrypted ressource if DECRYPT build Option is disabled.
index 9d41b04..7fe9e65 100644 (file)
@@ -117,12 +117,18 @@ bool checkWhitelist(const char *url)
         return true;
     }
 
-    DPL::ScopedPtr<iri_t> iri(iri_parse(url));
+    iri_t* iri = iri_parse(url);
+    if (!iri)
+        return false;
+
     if (!iri->scheme || !iri->host || strlen(iri->host) == 0) {
+        iri_destroy(iri);
         return true;
     }
+
     std::string scheme = iri->scheme;
     std::string host = iri->host;
+    iri_destroy(iri);
 
     if (scheme.find(SCHEME_TYPE_HTTP) == std::string::npos) {
         LogDebug("url doesn't need to check white list");