diff options
author | Dan Winship <danw@src.gnome.org> | 2008-11-03 22:11:51 +0000 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2008-11-03 22:11:51 +0000 |
commit | 23978458ba1d2febe7f953b6c42a6dbccd1f634a (patch) | |
tree | b30e4490324e906d733c7db3eb41d08f2ebd670b | |
parent | 504610db1ac86edf3d8400bad5666149b9e1d210 (diff) | |
download | libsoup-23978458ba1d2febe7f953b6c42a6dbccd1f634a.tar.gz |
don't leak the header string
* libsoup/soup-message-headers.c (set_content_foo): don't leak the
header string
* libsoup/soup-multipart.c (generate_boundary): avoid a (harmless)
valgrind warning
* libsoup/soup-proxy-resolver-static.c (get_proxy_sync): don't
leak the address on error
* libsoup/soup-session-sync.c (wait_for_connection): don't leak
proxy_addr
* tests/misc-test.c: don't leak the SoupMessage signal ids
* tests/range-test.c (main): don't leak base_uri
* tests/libsoup.supp: update this using lots and lots of wildcards
svn path=/trunk/; revision=1197
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | libsoup/soup-message-headers.c | 4 | ||||
-rw-r--r-- | libsoup/soup-multipart.c | 4 | ||||
-rw-r--r-- | libsoup/soup-proxy-resolver-static.c | 8 | ||||
-rw-r--r-- | libsoup/soup-session-sync.c | 6 | ||||
-rw-r--r-- | tests/libsoup.supp | 1408 | ||||
-rw-r--r-- | tests/misc-test.c | 24 | ||||
-rw-r--r-- | tests/range-test.c | 1 |
8 files changed, 589 insertions, 886 deletions
@@ -1,5 +1,25 @@ 2008-11-03 Dan Winship <danw@gnome.org> + * libsoup/soup-message-headers.c (set_content_foo): don't leak the + header string + + * libsoup/soup-multipart.c (generate_boundary): avoid a (harmless) + valgrind warning + + * libsoup/soup-proxy-resolver-static.c (get_proxy_sync): don't + leak the address on error + + * libsoup/soup-session-sync.c (wait_for_connection): don't leak + proxy_addr + + * tests/misc-test.c: don't leak the SoupMessage signal ids + + * tests/range-test.c (main): don't leak base_uri + + * tests/libsoup.supp: update this using lots and lots of wildcards + +2008-11-03 Dan Winship <danw@gnome.org> + * libsoup/soup-session.c (message_finished): Fix the signal handler disconnection here: for "finished" we were passing the wrong user_data to g_signal_handlers_disconnect_by_func(), and for diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c index 2babedc7..b5e9f59f 100644 --- a/libsoup/soup-message-headers.c +++ b/libsoup/soup-message-headers.c @@ -1002,8 +1002,8 @@ set_content_foo (SoupMessageHeaders *hdrs, const char *header_name, } } - soup_message_headers_replace (hdrs, header_name, - g_string_free (str, FALSE)); + soup_message_headers_replace (hdrs, header_name, str->str); + g_string_free (str, TRUE); } static void diff --git a/libsoup/soup-multipart.c b/libsoup/soup-multipart.c index b7059af2..33b94e85 100644 --- a/libsoup/soup-multipart.c +++ b/libsoup/soup-multipart.c @@ -61,6 +61,10 @@ generate_boundary (void) int counter; } data; + /* avoid valgrind warning */ + if (sizeof (data) != sizeof (data.timeval) + sizeof (data.counter)) + memset (&data, 0, sizeof (data)); + g_get_current_time (&data.timeval); data.counter = counter++; diff --git a/libsoup/soup-proxy-resolver-static.c b/libsoup/soup-proxy-resolver-static.c index 3548e591..575eac19 100644 --- a/libsoup/soup-proxy-resolver-static.c +++ b/libsoup/soup-proxy-resolver-static.c @@ -201,8 +201,14 @@ get_proxy_sync (SoupProxyResolver *proxy_resolver, { SoupProxyResolverStaticPrivate *priv = SOUP_PROXY_RESOLVER_STATIC_GET_PRIVATE (proxy_resolver); + guint status; *addr = soup_address_new (priv->proxy_uri->host, priv->proxy_uri->port); - return soup_status_proxify (soup_address_resolve_sync (*addr, cancellable)); + status = soup_status_proxify (soup_address_resolve_sync (*addr, cancellable)); + if (!SOUP_STATUS_IS_SUCCESSFUL (status)) { + g_object_unref (*addr); + *addr = NULL; + } + return status; } diff --git a/libsoup/soup-session-sync.c b/libsoup/soup-session-sync.c index 94ed284c..e1f6912a 100644 --- a/libsoup/soup-session-sync.c +++ b/libsoup/soup-session-sync.c @@ -141,10 +141,6 @@ wait_for_connection (SoupSession *session, SoupMessage *msg) g_mutex_lock (priv->lock); try_again: - if (proxy_addr) { - g_object_unref (proxy_addr); - proxy_addr = NULL; - } if (proxy_resolver) { status = soup_proxy_resolver_get_proxy_sync (proxy_resolver, msg, NULL, &proxy_addr); if (!SOUP_STATUS_IS_SUCCESSFUL (status)) { @@ -155,6 +151,8 @@ wait_for_connection (SoupSession *session, SoupMessage *msg) conn = soup_session_get_connection (session, msg, proxy_addr, &try_pruning, &is_new); + if (proxy_addr) + g_object_unref (proxy_addr); if (conn) { if (is_new) { status = soup_connection_connect_sync (conn); diff --git a/tests/libsoup.supp b/tests/libsoup.supp index 6e69cb50..37da38d0 100644 --- a/tests/libsoup.supp +++ b/tests/libsoup.supp @@ -1,1196 +1,870 @@ # valgrind suppressions file { - glib/quark1 + glib/g_quark_new_1 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_hash_table_insert_internal - fun:g_hash_table_insert + fun:* fun:g_quark_new } { - glib/quark2 + glib/g_quark_new_2 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc + fun:* + fun:* fun:g_quark_new } { - glib/quark3 + glib/g_quark_new_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_hash_table_new_full - fun:g_hash_table_new + fun:* + fun:* + fun:* fun:g_quark_new } { - glib/quark4 + glib/g_quark_new_4 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_hash_table_resize - fun:g_hash_table_maybe_resize - fun:g_hash_table_insert_internal - fun:g_hash_table_insert + fun:* + fun:* + fun:* + fun:* fun:g_quark_new } { - glib/typeinit1 + glib/g_quark_new_5 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:g_bsearch_array_grow - fun:g_bsearch_array_insert - fun:g_bsearch_array_replace - fun:g_value_register_transform_func - fun:g_value_transforms_init - fun:g_type_init_with_debug_flags + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_quark_new } { - glib/typeinit2 + glib/g_quark_new_6 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_class_init_Wm - fun:g_type_class_ref + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_quark_new } { - glib/typeinit3 + glib/g_quark_from_static_string_3 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_node_any_new_W - fun:type_node_fundamental_new_W - fun:g_type_init_with_debug_flags + fun:* + fun:* + fun:* + fun:g_quark_from_static_string } { - glib/typeinit4 + glib/g_quark_from_static_string_4 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_data_make_W - fun:g_type_init_with_debug_flags + fun:* + fun:* + fun:* + fun:* + fun:g_quark_from_static_string } { - glib/property + glib/g_quark_from_string_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_slist_prepend - fun:g_object_class_install_property + fun:* + fun:* + fun:* + fun:g_quark_from_string } { - glib/gparamtypes1 + glib/g_quark_from_string_4 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_param_spec_types_init + fun:* + fun:* + fun:* + fun:* + fun:g_quark_from_string } { - glib/paramtypes2 + glib/g_type_init_with_debug_flags_2 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_param_type_register_static - fun:g_param_spec_types_init + fun:* + fun:* + fun:g_type_init_with_debug_flags } { - glib/paramtypes3 + glib/g_type_init_with_debug_flags_3 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:g_boxed_type_register_static - fun:g_value_array_get_type - fun:g_param_spec_types_init + fun:* + fun:* + fun:* + fun:g_type_init_with_debug_flags } { - glib/boxedtype + glib/g_type_init_with_debug_flags_4 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:g_bsearch_array_grow - fun:g_bsearch_array_insert - fun:g_boxed_type_register_static + fun:* + fun:* + fun:* + fun:* + fun:g_type_init_with_debug_flags } { - glib/typereg1 + glib/g_type_init_with_debug_flags_5 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_data_make_W - fun:g_type_register_static + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_init_with_debug_flags } { - glib/typereg2 + glib/g_type_init_with_debug_flags_6 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_add_flags_W - fun:g_type_register_static + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_init_with_debug_flags } { - glib/typereg3 + glib/g_type_init_with_debug_flags_7 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_hash_table_resize - fun:g_hash_table_maybe_resize - fun:g_hash_table_insert_internal - fun:g_hash_table_insert - fun:type_node_any_new_W - fun:type_node_new_W - fun:g_type_register_static + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_init_with_debug_flags } { - glib/typereg4 + glib/g_object_class_install_property_4 Memcheck:Leak - fun:realloc - fun:g_realloc0 - fun:type_node_any_new_W - fun:g_type_register_static + fun:* + fun:* + fun:* + fun:* + fun:g_object_class_install_property } { - glib/typereg5 + glib/g_param_spec_types_init_2 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_node_any_new_W - fun:type_node_new_W - fun:g_type_register_static + fun:* + fun:* + fun:g_param_spec_types_init } { - glib/typereg6 + glib/g_param_spec_types_init_3 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:type_node_any_new_W - fun:type_node_new_W - fun:g_type_register_static + fun:* + fun:* + fun:* + fun:g_param_spec_types_init } { - glib/typereg7 + glib/g_param_spec_types_init_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_memdup - fun:type_node_any_new_W - fun:g_type_register_static + fun:* + fun:* + fun:* + fun:* + fun:g_param_spec_types_init } { - glib/typereg8 + glib/g_type_register_static_1 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:type_node_any_new_W + fun:* fun:g_type_register_static } { - glib/typereg9 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_set_qdata_W - fun:type_add_flags_W - fun:g_type_register_fundamental -} -{ - glib/typereg10 - Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:type_set_qdata_W - fun:type_add_flags_W - fun:g_type_register_fundamental -} -{ - glib/typereg11 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_data_make_W - fun:g_type_register_fundamental -} -{ - glib/typereg12 + glib/g_type_register_static_2 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:type_node_any_new_W - fun:type_node_new_W + fun:* + fun:* fun:g_type_register_static } { - glib/typereg13 + glib/g_type_register_static_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_quark_from_string_internal - fun:g_quark_from_string - fun:type_node_any_new_W - fun:type_node_new_W + fun:* + fun:* + fun:* fun:g_type_register_static } { - glib/typereg14 + glib/g_type_register_static_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_memdup - fun:type_node_any_new_W + fun:* + fun:* + fun:* + fun:* fun:g_type_register_static } { - glib/typereg15 + glib/g_type_register_static_5 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:type_set_qdata_W - fun:type_add_interface_Wm -} -{ - glib/typereg16 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_memdup - fun:type_node_any_new_W - fun:type_node_new_W + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_type_register_static } { - glib/typereg17 + glib/g_type_register_static_6 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:type_set_qdata_W - fun:type_add_flags_W + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_type_register_static } { - glib/typereg18 + glib/g_type_register_static_7 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_set_qdata_W - fun:type_add_flags_W + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_type_register_static } { - glib/interface1 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_add_interface_Wm - fun:g_type_add_interface_static -} -{ - glib/interface2 - Memcheck:Leak - fun:realloc - fun:g_realloc - fun:type_add_interface_Wm - fun:g_type_add_interface_static -} -{ - glib/interface3 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_memdup - fun:type_add_interface_Wm - fun:g_type_add_interface_static -} -{ - glib/interface4 - Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:type_node_add_iface_entry_W - fun:type_add_interface_Wm - fun:g_type_add_interface_static -} -{ - glib/interface5 + glib/g_type_register_static_8 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:type_iface_add_prerequisite_W - fun:g_type_interface_add_prerequisite -} -{ - glib/paramspec1 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_slice_alloc0 - fun:g_type_create_instance - fun:g_param_spec_internal -} -{ - glib/paramspec2 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_param_spec_internal -} -{ - glib/paramspec3 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_param_spec_string + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_register_static } { - glib/signalinit1 + glib/g_type_register_fundamental_3 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_hash_table_new_full - fun:g_signal_init + fun:* + fun:* + fun:* + fun:g_type_register_fundamental } { - glib/signalinit2 + glib/g_type_register_fundamental_4 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:g_bsearch_array_create - fun:g_signal_init + fun:* + fun:* + fun:* + fun:* + fun:g_type_register_fundamental } { - glib/signalinit3 + glib/g_type_register_fundamental_5 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:g_signal_init + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_register_fundamental } { - glib/signal1 + glib/g_type_register_fundamental_6 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_signal_newv - fun:g_signal_new_valist + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_register_fundamental } { - glib/signal2 + glib/g_type_add_interface_static_3 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:g_signal_newv - fun:g_signal_new_valist + fun:* + fun:* + fun:* + fun:g_type_add_interface_static } { - glib/signal3 + glib/g_type_add_interface_static_4 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_closure_new_simple - fun:g_signal_type_cclosure_new - fun:g_signal_new + fun:* + fun:* + fun:* + fun:* + fun:g_type_add_interface_static } { - glib/signal4 + glib/g_type_add_interface_static_5 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:signal_add_class_closure - fun:g_signal_newv - fun:g_signal_new_valist - fun:g_signal_new + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_add_interface_static } { - glib/signal5 + glib/g_boxed_type_register_static_2 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:g_closure_set_meta_marshal - fun:g_signal_type_cclosure_new - fun:g_signal_new + fun:* + fun:* + fun:g_boxed_type_register_static } { - glib/signal7 + glib/g_signal_newv_2 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_memdup + fun:* + fun:* fun:g_signal_newv } { - glib/signal8 + glib/g_signal_newv_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_quark_from_string_internal - fun:g_quark_from_string + fun:* + fun:* + fun:* fun:g_signal_newv } { - glib/signal9 + glib/g_signal_newv_4 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:g_bsearch_array_grow - fun:g_bsearch_array_insert + fun:* + fun:* + fun:* + fun:* fun:g_signal_newv } { - glib/signal10 + glib/g_signal_newv_5 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:g_bsearch_array_grow - fun:g_bsearch_array_insert - fun:signal_add_class_closure + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_signal_newv } { - glib/signal11 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_hash_table_new_full - fun:g_hash_table_new - fun:g_signal_init -} -{ - glib/gslice - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_slice_init_nomessage -} -{ - glib/typeref1 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_type_class_ref - fun:g_object_newv -} -{ - glib/typeref2 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_type_class_ref - fun:g_object_new_valist -} -{ - glib/typeref3 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_type_class_ref - fun:g_type_create_instance -} -{ - glib/typeref4 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_type_class_ref - fun:g_type_class_ref -} -{ - glib/typeref5 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_param_spec_pool_new - fun:g_object_do_class_init -} -{ - glib/typeref7 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:type_iface_ensure_dflt_vtable_Wm - fun:type_iface_vtable_base_init_Wm -} -{ - glib/typeref8 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_memdup - fun:type_iface_vtable_base_init_Wm -} -{ - glib/typeref9 - Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:g_type_add_interface_check - fun:g_type_class_ref -} -{ - glib/typeref10 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_slist_copy - fun:g_object_base_class_init - fun:g_type_class_ref -} -{ - glib/typeref11 + glib/g_signal_new_4 Memcheck:Leak - fun:malloc - fun:realloc - fun:g_realloc - fun:g_type_add_interface_check + fun:* + fun:* + fun:* + fun:* + fun:g_signal_new } { - glib/typeref12 + glib/g_signal_new_5 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_slist_copy - fun:g_object_base_class_init - fun:type_class_init_Wm - fun:g_type_class_ref + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_signal_new } { - glib/langnames1 + glib/g_get_language_names_2 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:read_aliases - fun:unalias_lang + fun:* + fun:* fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init } { - glib/langnames2 + glib/g_get_language_names_3 Memcheck:Leak - fun:realloc - fun:g_realloc - fun:g_array_maybe_expand - fun:g_array_set_size - fun:g_static_private_set + fun:* + fun:* + fun:* fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init } { - glib/langnames3 + glib/g_get_language_names_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strconcat - fun:_g_compute_locale_variants + fun:* + fun:* + fun:* + fun:* fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init } { - glib/langnames4 + glib/g_get_language_names_5 Memcheck:Leak - fun:malloc - fun:g_malloc + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init } { - glib/langnames5 + glib/g_intern_static_string_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init + fun:* + fun:* + fun:* + fun:g_intern_static_string } { - glib/langnames6 + glib/g_intern_static_string_4 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init + fun:* + fun:* + fun:* + fun:* + fun:g_intern_static_string } { - glib/langnames7 + glib/g_intern_string_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init -} -{ - glib/langnames8 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_hash_table_new_full - fun:g_hash_table_new - fun:read_aliases - fun:unalias_lang - fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init + fun:* + fun:* + fun:* + fun:* + fun:g_intern_string } { - glib/langnames9 + glib/g_intern_string_3 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_hash_table_resize - fun:g_hash_table_maybe_resize - fun:g_hash_table_insert_internal - fun:g_hash_table_insert - fun:read_aliases - fun:unalias_lang - fun:g_get_language_names - fun:_g_utils_thread_init - fun:g_thread_init_glib - fun:g_thread_init + fun:* + fun:* + fun:* + fun:g_intern_string } { - glib/charsets + glib/g_thread_init_glib_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_array_sized_new - fun:g_array_new - fun:g_static_private_set - fun:g_get_filename_charsets - fun:_g_convert_thread_init + fun:* + fun:* + fun:* fun:g_thread_init_glib - fun:g_thread_init -} -{ - glib/prgname - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_set_prgname -} -{ - glib/intern - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_quark_from_string_internal - fun:g_intern_string } { - glib/gthreadinit1 + glib/g_thread_init_glib_4 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_thread_self + fun:* + fun:* + fun:* + fun:* fun:g_thread_init_glib } { - glib/gthreadinit2 + glib/g_thread_init_glib_5 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_cond_new_posix_impl + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_thread_init_glib } { - glib/gthreadinit3 + glib/g_thread_init_glib_6 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_mutex_new_posix_impl + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_thread_init_glib } { - glib/gthreadinit4 + glib/g_thread_init_glib_y Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_mutex_new_posix_impl - fun:_g_mem_thread_init_noprivate_nomessage + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_thread_init_glib } { - glib/gthreadinit5 + glib/g_type_class_ref_2 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_mutex_new_posix_impl - fun:_g_slice_thread_init_nomessage - fun:g_thread_init_glib + fun:* + fun:* + fun:g_type_class_ref } { - glib/gthreadinit6 + glib/g_type_class_ref_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_mutex_new_posix_impl - fun:_g_slice_thread_init_nomessage - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:g_type_class_ref } { - glib/gthreadinit7 + glib/g_type_class_ref_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_mutex_new_posix_impl - fun:_g_messages_thread_init_nomessage - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:* + fun:g_type_class_ref } { - glib/gthreadinit8 + glib/g_type_class_ref_5 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_get_filename_charsets - fun:_g_convert_thread_init - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_class_ref } { - glib/gthreadinit9 + glib/g_type_class_ref_6 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_slice_alloc - fun:g_array_sized_new - fun:g_static_private_set - fun:g_get_filename_charsets - fun:_g_convert_thread_init - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_class_ref } { - glib/gthreadinit10 + glib/g_type_class_ref_7 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_get_charset - fun:g_get_filename_charsets - fun:_g_convert_thread_init - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_class_ref } { - glib/threadinit11 + glib/g_type_class_ref_8 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_get_charset - fun:g_get_filename_charsets - fun:_g_convert_thread_init - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_class_ref } { - glib/threadinit12 + glib/g_type_class_ref_9 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_get_charset - fun:g_get_filename_charsets - fun:_g_convert_thread_init - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:g_type_class_ref } { - glib/threadinit13 + glib/g_type_interface_add_prerequisite_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_get_filename_charsets - fun:_g_convert_thread_init - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:g_type_interface_add_prerequisite } { - glib/threadinit14 + glib/g_type_interface_add_prerequisite_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:g_get_filename_charsets - fun:_g_convert_thread_init - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:* + fun:g_type_interface_add_prerequisite } { - glib/threadinit15 + glib/g_data_initialize_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_private_new_posix_impl - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:g_data_initialize } { - glib/threadinit16 + glib/g_data_initialize_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_private_new_posix_impl - fun:_g_slice_thread_init_nomessage - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:* + fun:g_data_initialize } { - glib/threadinit17 + glib/g_static_rw_lock_writer_lock_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_private_new_posix_impl - fun:_g_messages_thread_init_nomessage - fun:g_thread_init_glib + fun:* + fun:* + fun:* + fun:g_static_rw_lock_writer_lock } { - glib/gdata + glib/g_set_prgname_3 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_hash_table_new_full - fun:g_hash_table_new - fun:g_data_initialize + fun:* + fun:* + fun:* + fun:g_set_prgname } { - glib/childwatch1 + glib/get_dispatch_4 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_thread_create_full - fun:g_child_watch_source_init_multi_threaded + fun:* + fun:* + fun:* + fun:* + fun:get_dispatch } { - glib/childwatch2 + glib/g_child_watch_source_init_multi_threaded_3 Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.1 - fun:g_thread_create_posix_impl - fun:g_thread_create_full + fun:* + fun:* + fun:* fun:g_child_watch_source_init_multi_threaded - fun:g_child_watch_source_init } { - glib/childwatch2b + glib/g_child_watch_source_init_multi_threaded_5 Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.2.5 - fun:g_thread_create_posix_impl - fun:g_thread_create_full + fun:* + fun:* + fun:* + fun:* + fun:* fun:g_child_watch_source_init_multi_threaded - fun:g_child_watch_source_init } { - libxml2/encoding1 + libxml2/xmlInitCharEncodingHandlers_1 Memcheck:Leak - fun:malloc + fun:* fun:xmlInitCharEncodingHandlers } { - libxml2/encoding2 + libxml2/xmlInitCharEncodingHandlers_2 Memcheck:Leak - fun:malloc - fun:xmlNewCharEncodingHandler + fun:* + fun:* fun:xmlInitCharEncodingHandlers } { - libxml2/encoding3 + libxml2/xmlInitCharEncodingHandlers_3 Memcheck:Leak - fun:malloc - fun:xmlStrndup - fun:xmlStrdup - fun:xmlNewCharEncodingHandler + fun:* + fun:* + fun:* fun:xmlInitCharEncodingHandlers } { - libxml2/globals - Memcheck:Leak - fun:malloc - fun:xmlNewMutex - fun:xmlInitGlobals -} -{ - libxml2/dict - Memcheck:Leak - fun:malloc - fun:xmlNewRMutex - fun:xmlInitializeDict -} -{ - libxml2/memory - Memcheck:Leak - fun:malloc - fun:xmlNewMutex - fun:xmlInitMemory -} -{ - libxml2/parse + libxml2/xmlInitializeDict Memcheck:Leak fun:malloc fun:xmlNewRMutex fun:xmlDictCreate - fun:xmlInitParserCtxt -} - -{ - gnutls/init1 - Memcheck:Leak - fun:calloc - fun:_asn1_add_node - fun:asn1_array2tree - fun:gnutls_global_init } { - gnutls/init2 + libxml2/xmlInitParser_3 Memcheck:Leak - fun:calloc - fun:_asn1_add_node_only - fun:_asn1_expand_object_id - fun:asn1_array2tree - fun:gnutls_global_init + fun:* + fun:* + fun:* + fun:xmlInitParser } + + { - gnutls/init3 + gnutls/gnutls_global_init_3 Memcheck:Leak - fun:malloc - fun:strdup - fun:_asn1_set_name - fun:asn1_array2tree + fun:* + fun:* + fun:* fun:gnutls_global_init } { - gnutls/init4 + gnutls/gnutls_global_init_4 Memcheck:Leak - fun:malloc - fun:_asn1_set_value - fun:asn1_array2tree + fun:* + fun:* + fun:* + fun:* fun:gnutls_global_init } { - gnutls/init5 + gnutls/gnutls_global_init_5 Memcheck:Leak - fun:malloc - fun:strdup - fun:_asn1_set_name - fun:_asn1_expand_object_id - fun:asn1_array2tree + fun:* + fun:* + fun:* + fun:* + fun:* fun:gnutls_global_init } { - gnutls/init6 + gnutls/gnutls_global_init_7 Memcheck:Leak - fun:malloc - fun:do_malloc - fun:_gcry_malloc - fun:_gcry_xmalloc - fun:_gcry_xcalloc - fun:initialize - fun:_gcry_randomize -} -{ - gnutls/init7 - Memcheck:Leak - fun:malloc - fun:_asn1_set_value - fun:_asn1_expand_object_id - fun:asn1_array2tree + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* fun:gnutls_global_init } { - gnutls/init8 + gnutls/gnutls_global_init_9 Memcheck:Leak - fun:malloc - fun:_gcry_private_malloc - fun:do_malloc - fun:_gcry_malloc - fun:_gcry_module_add - fun:gcry_cipher_register_default - fun:_gcry_cipher_init -} -{ - gnutls/init9 - Memcheck:Leak - fun:malloc - fun:_asn1_set_value - fun:_asn1_change_integer_value - fun:asn1_array2tree + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* fun:gnutls_global_init } { - gnutls/init10 + gnutls/soup_gnutls_init_gcry_control_4 Memcheck:Leak - fun:malloc - fun:gcry_pthread_mutex_init - fun:mutex_init - fun:_gcry_ath_mutex_lock - fun:_gcry_cipher_init - fun:global_init -} -{ - gnutls/init11 - Memcheck:Leak - fun:malloc - fun:gcry_pthread_mutex_init - fun:_gcry_ath_init - fun:global_init + fun:* + fun:* + fun:* + fun:* + fun:gcry_control + fun:soup_gnutls_init } { - gnutls/init12 + gnutls/soup_gnutls_init_gcry_control_7 Memcheck:Leak - fun:malloc - fun:gcry_pthread_mutex_init - fun:mutex_init - fun:initialize_basics + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:gcry_control + fun:soup_gnutls_init } { - gnutls/init13 + gnutls/soup_gnutls_init_gcry_control_8 Memcheck:Leak - fun:malloc - fun:gcry_pthread_mutex_init - fun:mutex_init - fun:initialize_basics + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* fun:gcry_control - fun:gnutls_global_init + fun:soup_gnutls_init } { - gnutls/deflate - Memcheck:Cond - fun:longest_match - fun:deflate_fast - fun:deflate - fun:_gnutls_compress - fun:_gnutls_m_plaintext2compressed - fun:_gnutls_encrypt - fun:_gnutls_send_int - fun:gnutls_record_send + gnutls/gnutls_handshake_5 + Memcheck:Leak + fun:* + fun:* + fun:* + fun:* + fun:* + fun:gnutls_handshake } { - gnutls/handshake + gnutls/gnutls_handshake_6 Memcheck:Leak - fun:malloc - fun:_gnutls_mpi_dprint_lz - fun:_gnutls_dh_set_peer_public - fun:_gnutls_proc_dh_common_server_kx - fun:proc_dhe_server_kx - fun:_gnutls_recv_server_kx_message - fun:_gnutls_handshake_client + fun:* + fun:* + fun:* + fun:* + fun:* + fun:* fun:gnutls_handshake } { - libsoup/headers + libsoup/intern_header_name_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup - fun:intern_header_locked + fun:* + fun:* + fun:* fun:intern_header_name } { - libsoup/dnscache1 + libsoup/intern_header_name_4 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:g_hash_table_new_full - fun:soup_dns_init -} -{ - libsoup/dnscache2 - Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:soup_dns_cache_entry_new - fun:soup_dns_lookup_address + fun:* + fun:* + fun:* + fun:* + fun:intern_header_name } { - libsoup/dnscache3 + libsoup/intern_header_name_5 Memcheck:Leak - fun:calloc - fun:g_malloc0 - fun:soup_dns_cache_entry_new - fun:soup_dns_lookup_name + fun:* + fun:* + fun:* + fun:* + fun:* + fun:intern_header_name } { - libsoup/dnscache4 + libsoup/soup_dns_cache_entry_new_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_memdup - fun:soup_dns_cache_entry_set_from_phys + fun:* + fun:* + fun:* fun:soup_dns_cache_entry_new } { - libsoup/dnscache5 + libsoup/soup_dns_cache_entry_new_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup + fun:* + fun:* + fun:* + fun:* fun:soup_dns_cache_entry_new } { - libsoup/dnscache6 + libsoup/soup_dns_lookup_name_3 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_memdup - fun:resolve_address -} -{ - libsoup/dnscache7 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_strdup + fun:* + fun:* + fun:* fun:soup_dns_lookup_name } { - libsoup/dns1 + libsoup/resolver_thread_4 Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_cond_new_posix_impl - fun:soup_dns_init -} -{ - libsoup/dns2 - Memcheck:Leak - fun:malloc - fun:g_malloc - fun:g_mutex_new_posix_impl - fun:soup_dns_init + fun:* + fun:* + fun:* + fun:* + fun:resolver_thread } diff --git a/tests/misc-test.c b/tests/misc-test.c index 2f839075..6bb50165 100644 --- a/tests/misc-test.c +++ b/tests/misc-test.c @@ -204,19 +204,15 @@ do_callback_unref_test (void) * #559054 */ static void -ensure_no_signal_handlers (SoupMessage *msg) +ensure_no_signal_handlers (SoupMessage *msg, guint *signal_ids, guint n_signal_ids) { - static guint *ids, n_ids; int i; - if (!ids) - ids = g_signal_list_ids (SOUP_TYPE_MESSAGE, &n_ids); - - for (i = 0; i < n_ids; i++) { - if (g_signal_handler_find (msg, G_SIGNAL_MATCH_ID, ids[i], + for (i = 0; i < n_signal_ids; i++) { + if (g_signal_handler_find (msg, G_SIGNAL_MATCH_ID, signal_ids[i], 0, NULL, NULL, NULL)) { debug_printf (1, " Message has handler for '%s'\n", - g_signal_name (ids[i])); + g_signal_name (signal_ids[i])); errors++; } } @@ -239,9 +235,12 @@ do_msg_reuse_test (void) SoupSession *session; SoupMessage *msg; SoupURI *uri; + guint *signal_ids, n_signal_ids; debug_printf (1, "\nSoupMessage reuse\n"); + signal_ids = g_signal_list_ids (SOUP_TYPE_MESSAGE, &n_signal_ids); + session = soup_test_session_new (SOUP_TYPE_SESSION_SYNC, NULL); g_signal_connect (session, "authenticate", G_CALLBACK (reuse_test_authenticate), NULL); @@ -249,7 +248,7 @@ do_msg_reuse_test (void) debug_printf (1, " First message\n"); msg = soup_message_new_from_uri ("GET", base_uri); soup_session_send_message (session, msg); - ensure_no_signal_handlers (msg); + ensure_no_signal_handlers (msg, signal_ids, n_signal_ids); debug_printf (1, " Redirect message\n"); uri = soup_uri_new_with_base (base_uri, "/redirect"); @@ -260,7 +259,7 @@ do_msg_reuse_test (void) debug_printf (1, " Message did not get redirected!\n"); errors++; } - ensure_no_signal_handlers (msg); + ensure_no_signal_handlers (msg, signal_ids, n_signal_ids); debug_printf (1, " Auth message\n"); uri = soup_uri_new_with_base (base_uri, "/auth"); @@ -271,16 +270,17 @@ do_msg_reuse_test (void) debug_printf (1, " Message did not get authenticated!\n"); errors++; } - ensure_no_signal_handlers (msg); + ensure_no_signal_handlers (msg, signal_ids, n_signal_ids); /* One last try to make sure the auth stuff got cleaned up */ debug_printf (1, " Last message\n"); soup_message_set_uri (msg, base_uri); soup_session_send_message (session, msg); - ensure_no_signal_handlers (msg); + ensure_no_signal_handlers (msg, signal_ids, n_signal_ids); soup_test_session_abort_unref (session); g_object_unref (msg); + g_free (signal_ids); } int diff --git a/tests/range-test.c b/tests/range-test.c index 214244ba..d33f9532 100644 --- a/tests/range-test.c +++ b/tests/range-test.c @@ -364,6 +364,7 @@ main (int argc, char **argv) base_uri = g_strdup_printf ("http://localhost:%u/", soup_server_get_port (server)); do_range_test (session, base_uri, TRUE); + g_free (base_uri); soup_test_session_abort_unref (session); |