2009-03-01 Gustavo Noronha Silva <gns@gnome.org>
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Mar 2009 16:22:15 +0000 (16:22 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Mar 2009 16:22:15 +0000 (16:22 +0000)
        Reviewed by Holger Freyther.

        Avoid leaking errors when reporting GIO errors.

        * platform/network/soup/ResourceHandleSoup.cpp:
        (WebCore::readCallback):
        (WebCore::openCallback):
        (WebCore::queryInfoCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41333 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/network/soup/ResourceHandleSoup.cpp

index aaccbece663ab5d9186941462a12811e180468c1..33abd71820f41cc282b6cf3c3cbed11a9f95f85f 100644 (file)
@@ -1,3 +1,14 @@
+2009-03-01  Gustavo Noronha Silva  <gns@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        Avoid leaking errors when reporting GIO errors.
+
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::readCallback):
+        (WebCore::openCallback):
+        (WebCore::queryInfoCallback):
+
 2009-03-01  Gustavo Noronha Silva  <gns@gnome.org>
 
         Reviewed by Holger Freyther.
index bc675512d95451dc46b81f7f94d1000d650e13da..1ca657fb39a631ca1c40132d38b7df1ee1eb1a43 100644 (file)
@@ -696,6 +696,7 @@ static void readCallback(GObject* source, GAsyncResult* res, gpointer)
     nread = g_input_stream_read_finish(d->m_input_stream, res, &error);
     if (error) {
         ResourceError resourceError = networkErrorForFile(d->m_gfile, error);
+        g_error_free(error);
         cleanupGioOperation(d);
         client->didFail(handle.get(), resourceError);
         return;
@@ -737,6 +738,7 @@ static void openCallback(GObject* source, GAsyncResult* res, gpointer)
     in = g_file_read_finish(G_FILE(source), res, &error);
     if (error) {
         ResourceError resourceError = networkErrorForFile(d->m_gfile, error);
+        g_error_free(error);
         cleanupGioOperation(d);
         client->didFail(handle, resourceError);
         return;
@@ -784,6 +786,7 @@ static void queryInfoCallback(GObject* source, GAsyncResult* res, gpointer)
         // for a while).
 
         ResourceError resourceError = networkErrorForFile(d->m_gfile, error);
+        g_error_free(error);
         cleanupGioOperation(d);
         client->didFail(handle, resourceError);
         return;
@@ -793,7 +796,7 @@ static void queryInfoCallback(GObject* source, GAsyncResult* res, gpointer)
         // FIXME: what if the URI points to a directory? Should we
         // generate a listing? How? What do other backends do here?
 
-        ResourceError resourceError = networkErrorForFile(d->m_gfile, error);
+        ResourceError resourceError = networkErrorForFile(d->m_gfile, 0);
         cleanupGioOperation(d);
         client->didFail(handle, resourceError);
         return;