X-Git-Url: http://git.jankratochvil.net/?p=gnome-vfs-httpcaptive.git;a=blobdiff_plain;f=modules%2Fhttp-method.c;h=d8e0b737cc3851a2ba28604087645eafcf1dcc44;hp=cba1274d1ca9b09867af608bb90a5580c4db1179;hb=46dd08e22706c7ac288952cff5e1ef4ce95c160a;hpb=29de1f992fb3c15271a72e0f41af16f2f0e521d1 diff --git a/modules/http-method.c b/modules/http-method.c index cba1274..d8e0b73 100644 --- a/modules/http-method.c +++ b/modules/http-method.c @@ -2264,6 +2264,7 @@ make_propfind_request (HttpFileHandle *handle, xmlNodePtr cur = NULL; char *extraheaders = g_strdup_printf("Depth: %d\r\n", depth); gboolean found_root_node_props; + gboolean handle_valid = FALSE; GByteArray *request = g_byte_array_new(); char *request_str = "" @@ -2290,6 +2291,8 @@ make_propfind_request (HttpFileHandle *handle, result = make_request (handle, uri, "PROPFIND", request, extraheaders, context); + if (result == GNOME_VFS_OK) + handle_valid = TRUE; /* FIXME bugzilla.gnome.org 43834: It looks like some http * servers (eg, www.yahoo.com) treat PROPFIND as a GET and @@ -2400,9 +2403,8 @@ cleanup: g_free(extraheaders); xmlFreeParserCtxt(parserContext); - if (result != GNOME_VFS_OK) { + if (result != GNOME_VFS_OK && handle_valid) { http_handle_close (handle, context); - g_free (handle); } ANALYZE_HTTP ("==> -make_propfind_request"); @@ -2588,6 +2590,8 @@ do_get_file_info (GnomeVFSMethod *method, g_free (handle); handle = NULL; } else { + g_free (handle); + handle = NULL; g_assert (handle == NULL); /* Make sure we're not leaking some old one */ /* Lame buggy servers (eg: www.mozilla.org, @@ -2606,8 +2610,9 @@ do_get_file_info (GnomeVFSMethod *method, gnome_vfs_file_info_copy (file_info, handle->file_info); http_cache_add_uri (uri, handle->file_info, FALSE); http_handle_close (handle, context); - g_free (handle); } + g_free (handle); + handle = NULL; /* If we get a redirect, we should be * basing the MIME type on the type of