After successfully writing a tag, the next read might fail in which case
tag_read_cb may be called several times. The pending write_msg pointer
needs to be unrefed only once.
- dbus_message_unref(tag->write_msg);
- tag->write_msg = NULL;
+ if (tag->write_msg) {
+ dbus_message_unref(tag->write_msg);
+ tag->write_msg = NULL;
+ }
__near_adapter_start_check_presence(adapter_idx, target_idx);
__near_adapter_start_check_presence(adapter_idx, target_idx);