diff --git a/libdmapsharing/daap-share.c b/libdmapsharing/daap-share.c index 798cadce29c288b43fef9e6b2101b3143154064f..e0251965f428dcdcfdf2435308f45890a4eb6461 100644 --- a/libdmapsharing/daap-share.c +++ b/libdmapsharing/daap-share.c @@ -415,7 +415,7 @@ send_chunked_file (SoupServer * server, SoupMessage * message, GError *error = NULL; ChunkData *cd = NULL; - cd = g_new (ChunkData, 1); + cd = g_new0 (ChunkData, 1); g_object_get (record, "location", &location, "has-video", &has_video, NULL); if (NULL == location) { diff --git a/libdmapsharing/dacp-share.c b/libdmapsharing/dacp-share.c index 50934dbbbe83d6081edefb9b31b340dd04eea880..47047244f1a046e2099139a5a3d4dc4bb727d96b 100644 --- a/libdmapsharing/dacp-share.c +++ b/libdmapsharing/dacp-share.c @@ -388,11 +388,11 @@ mdns_remote_added (DMAPMdnsBrowser * browser, { DACPRemoteInfo *remote_info; - remote_info = g_new (DACPRemoteInfo, 1); + remote_info = g_new0 (DACPRemoteInfo, 1); remote_info->host = g_strdup (service->host); remote_info->port = service->port; - remote_info->connection = NULL; remote_info->pair_txt = g_strdup (service->pair); + remote_info->connection = NULL; g_debug ("New Remote found: %s name=%s host=%s port=%u pair=%s", service->service_name, diff --git a/libdmapsharing/dmap-connection.c b/libdmapsharing/dmap-connection.c index d222835a807fff00a57b130e26927f495a8ef6bd..3bc749a6ed507dea85d2f308788bfb0757995988 100644 --- a/libdmapsharing/dmap-connection.c +++ b/libdmapsharing/dmap-connection.c @@ -1256,7 +1256,7 @@ dmap_connection_connect (DMAPConnection * connection, g_strdup_printf ("daap://%s:%d", connection->priv->host, connection->priv->port); - rdata = g_new (ConnectionResponseData, 1); + rdata = g_new0 (ConnectionResponseData, 1); rdata->connection = g_object_ref (connection); rdata->callback = callback; rdata->data = user_data; @@ -1334,7 +1334,7 @@ dmap_connection_disconnect (DMAPConnection * connection, // FIXME: GDK_THREADS_ENTER (); } - rdata = g_new (ConnectionResponseData, 1); + rdata = g_new0 (ConnectionResponseData, 1); rdata->connection = g_object_ref (connection); rdata->callback = callback; rdata->data = user_data; diff --git a/libdmapsharing/dmap-mdns-browser-avahi.c b/libdmapsharing/dmap-mdns-browser-avahi.c index aed9aa848dfd8fe92119b4f07fdbba525904dbde..8daa8d0b50928719242473b561eba9b403b5cdf9 100644 --- a/libdmapsharing/dmap-mdns-browser-avahi.c +++ b/libdmapsharing/dmap-mdns-browser-avahi.c @@ -431,7 +431,7 @@ resolve_cb (AvahiServiceResolver * service_resolver, avahi_address_snprint (host, AVAHI_ADDRESS_STR_MAX, address); - service = g_new (DMAPMdnsBrowserService, 1); + service = g_new0 (DMAPMdnsBrowserService, 1); service->service_name = g_strdup (service_name); service->name = name; service->host = g_strdup (host); diff --git a/libdmapsharing/dmap-mdns-browser-dnssd.c b/libdmapsharing/dmap-mdns-browser-dnssd.c index a40c1c80ad02b2844df2a043b32111f9ddd2fe01..c2c0cf0ffb3aef6d0fc83412cfc3ad741e645c34 100644 --- a/libdmapsharing/dmap-mdns-browser-dnssd.c +++ b/libdmapsharing/dmap-mdns-browser-dnssd.c @@ -103,7 +103,7 @@ signal_service_added (ServiceContext *context) DMAPMdnsBrowserService *service; - service = g_new (DMAPMdnsBrowserService, 1); + service = g_new0 (DMAPMdnsBrowserService, 1); // FIXME: The name and service_name variables need to be renamed. // Wait until working on DACP because I think this is when @@ -114,6 +114,7 @@ signal_service_added (ServiceContext *context) service->port = context->service.port; service->pair = g_strdup (context->service.pair); service->password_protected = context->service.password_protected; + service->transport_protocol = DMAP_MDNS_BROWSER_TRANSPORT_PROTOCOL_TCP; // add to the services list context->browser->priv->services = diff --git a/libdmapsharing/dmap-mdns-browser-howl.c b/libdmapsharing/dmap-mdns-browser-howl.c index d4cd03dfff31dd82e54c07f860b7c0bc59346cc6..d5c3a31585361203d92b7e4e7efdc50d93cb3ef0 100644 --- a/libdmapsharing/dmap-mdns-browser-howl.c +++ b/libdmapsharing/dmap-mdns-browser-howl.c @@ -267,13 +267,15 @@ resolve_cb (sw_discovery discovery, name = g_strdup (service_name); } - service = g_new (DMAPMdnsBrowserService, 1); + service = g_new0 (DMAPMdnsBrowserService, 1); service->service_name = g_strdup (service_name); service->name = name; service->host = g_strdup (host); service->port = port; service->password_protected = pp; service->pair = pair; + service->transport_protocol = DMAP_MDNS_BROWSER_TRANSPORT_PROTOCOL_TCP; + browser->priv->services = g_slist_append (browser->priv->services, service); diff --git a/libdmapsharing/dmap-mdns-publisher-avahi.c b/libdmapsharing/dmap-mdns-publisher-avahi.c index 45d859442179d41aad06bbeb0b9c2e74fc507e3c..488b5f8775069af312a12492948b08174c8978e6 100644 --- a/libdmapsharing/dmap-mdns-publisher-avahi.c +++ b/libdmapsharing/dmap-mdns-publisher-avahi.c @@ -284,7 +284,7 @@ dmap_mdns_publisher_publish (DMAPMdnsPublisher * publisher, return FALSE; } - service = g_new (struct DMAPMdnsPublisherService, 1); + service = g_new0 (struct DMAPMdnsPublisherService, 1); service->name = g_strdup (name); service->port = port; diff --git a/libdmapsharing/dmap-share.c b/libdmapsharing/dmap-share.c index 96635ba275fbec14f1ad8f114098e9f328eb4d99..5c548e364d44e6a28397042f30cf2d5f23855fed 100644 --- a/libdmapsharing/dmap-share.c +++ b/libdmapsharing/dmap-share.c @@ -1786,8 +1786,9 @@ _dmap_share_databases (DMAPShare * share, */ /* 1: */ - share_bitwise = g_new (struct share_bitwise_t, 1); + share_bitwise = g_new0 (struct share_bitwise_t, 1); + share_bitwise->share = share; share_bitwise->mb = mb; share_bitwise->id_list = NULL; share_bitwise->size = 0; @@ -1809,7 +1810,6 @@ _dmap_share_databases (DMAPShare * share, accumulate_mlcl_size_and_ids, share_bitwise); } - share_bitwise->share = share; /* 2: */ adbs = dmap_structure_add (NULL, DMAP_CC_ADBS); diff --git a/libdmapsharing/dpap-share.c b/libdmapsharing/dpap-share.c index 72ef3443ce9ef43e6d1ee9fd7a6e8cec98e51acd..cbe1922a402a9249609c0e9834bd580aa7ee1de8 100644 --- a/libdmapsharing/dpap-share.c +++ b/libdmapsharing/dpap-share.c @@ -514,7 +514,7 @@ send_chunked_file (SoupServer * server, SoupMessage * message, GInputStream *stream; const char *location; GError *error = NULL; - ChunkData *cd = g_new (ChunkData, 1); + ChunkData *cd = g_new0 (ChunkData, 1); g_object_get (record, "location", &location, NULL);