Changeset 149666 in webkit
- Timestamp:
- May 7, 2013 12:42:15 AM (11 years ago)
- Location:
- trunk/Source/WebKit/gtk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/gtk/ChangeLog
r149588 r149666 1 2013-05-07 Tomas Popela <tpopela@redhat.com> 2 3 [GTK] Initialize WebKitWebPlugin path to prevent double-free 4 https://bugs.webkit.org/show_bug.cgi?id=115624 5 6 Reviewed by Carlos Garcia Campos. 7 8 Use GOwnPtr for WebKitWebPlugin path to prevent double-free 9 situations. Also use GOwnPtr for GError in webkit_web_plugin_get_path. 10 11 * webkit/webkitwebplugin.cpp: 12 (webkit_web_plugin_finalize): 13 (webkit_web_plugin_get_path): 14 * webkit/webkitwebpluginprivate.h: 15 1 16 2013-05-06 Zan Dobersek <zdobersek@igalia.com> 2 17 -
trunk/Source/WebKit/gtk/webkit/webkitwebplugin.cpp
r148935 r149666 64 64 WebKitWebPluginPrivate* priv = plugin->priv; 65 65 66 g_free(priv->path);67 68 66 g_slist_foreach(priv->mimeTypes, (GFunc)freeMIMEType, 0); 69 67 g_slist_free(priv->mimeTypes); … … 192 190 193 191 if (priv->path) 194 return priv->path ;195 196 G Error* error = 0;197 priv->path = g_filename_from_utf8(priv->corePlugin->path().utf8().data(), -1, 0, 0, &error);192 return priv->path.get(); 193 194 GOwnPtr<GError> error; 195 priv->path.set(g_filename_from_utf8(priv->corePlugin->path().utf8().data(), -1, 0, 0, &error.outPtr())); 198 196 199 197 if (!error) 200 return priv->path ;198 return priv->path.get(); 201 199 202 200 // In the unlikely case the convertion fails, report the error and make sure we free 203 201 // any partial convertion that ended up in the variable. 204 g_free(priv->path); 205 priv->path = 0; 202 priv->path.clear(); 206 203 207 204 g_warning("Failed to convert '%s' to system filename encoding: %s", priv->corePlugin->path().utf8().data(), error->message); 208 209 g_clear_error(&error);210 205 211 206 return 0; -
trunk/Source/WebKit/gtk/webkit/webkitwebpluginprivate.h
r95901 r149666 22 22 #include "webkitwebplugin.h" 23 23 #include <glib-object.h> 24 #include <wtf/gobject/GOwnPtr.h> 24 25 #include <wtf/text/CString.h> 25 26 … … 39 40 CString name; 40 41 CString description; 41 char*path;42 GOwnPtr<char> path; 42 43 GSList* mimeTypes; 43 44 };
Note: See TracChangeset
for help on using the changeset viewer.