peer/reply: clean up reply object on failure
If a reply object exists, but the reply fails to send, clean up the
reply object regardles.
@@ -488,7 +488,7 @@ int peer_queue_call(Peer *receiver, Peer *sender, Message *message) {
}
int peer_queue_reply(Peer *sender, const char *destination, uint32_t reply_serial, Message *message) {
- ReplySlot *slot;
+ _c_cleanup_(reply_slot_freep) ReplySlot *slot = NULL;
Peer *receiver;
uint64_t id;
int r;
@@ -515,8 +515,6 @@ int peer_queue_reply(Peer *sender, const char *destination, uint32_t reply_seria
return error_fold(r);
}
- reply_slot_free(slot);
-
return 0;
}
