avahi_record_browser_free(r->record_browser);
r->record_browser = NULL;
- avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
- r->time_event = NULL;
+ if (r->time_event) {
+ avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
+ r->time_event = NULL;
+ }
r->callback(r, interface, protocol, event, &r->address, record ? record->data.ptr.name : NULL, r->userdata);
}
r->record_browser = avahi_record_browser_new(server, interface, protocol, k, record_browser_callback, r);
avahi_key_unref(k);
-
return r;
}
avahi_record_browser_free(r->record_browser_aaaa);
r->record_browser_aaaa = NULL;
}
-
- avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
- r->time_event = NULL;
+
+ if (r->time_event) {
+ avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
+ r->time_event = NULL;
+ }
if (record) {
switch (record->key->type) {
if (r->record_browser_a)
avahi_record_browser_free(r->record_browser_a);
+
if (r->record_browser_aaaa)
avahi_record_browser_free(r->record_browser_aaaa);
+
+ if (r->time_event)
+ avahi_time_event_queue_remove(r->server->time_event_queue, r->time_event);
g_free(r->host_name);
g_free(r);