[-] Lots of housekeeping thanks to scan-build and input from @acmay

This commit is contained in:
ejurgensen
2016-11-19 23:08:50 +01:00
parent 8525c278ec
commit bdd6bab982
21 changed files with 159 additions and 81 deletions

View File

@@ -498,12 +498,14 @@ browse_resolve_callback(AvahiServiceResolver *r, AvahiIfIndex intf, AvahiProtoco
DPRINTF(E_DBG, L_MDNS, "Avahi Resolver: resolved service '%s' type '%s' proto %d, host %s\n", name, type, proto, hostname);
rb_data = calloc(1, sizeof(struct mdns_record_browser));
if (! (rb_data && (rb_data->name = strdup(name)) && (rb_data->domain = strdup(domain))) )
if (!rb_data)
{
DPRINTF(E_LOG, L_MDNS, "Out of memory\n");
goto out_free_resolver;
}
rb_data->name = strdup(name);
rb_data->domain = strdup(domain);
rb_data->mb = (struct mdns_browser *)userdata;
rb_data->port = port;