}
}
-static void flowopt_cleanup(struct flowopts *fo)
+/**
+ * Deallocate all resources of a flowopts structure.
+ *
+ * \param fo A pointer as returned from flowopt_new().
+ *
+ * It's OK to pass \p NULL here in which case the function does nothing.
+ */
+void flowopt_cleanup(struct flowopts *fo)
{
struct pre_conn_opt *cur, *next;
*
* bind(2) is called on passive sockets, and connect(2) on active sockets. The
* algorithm tries all possible address combinations until it succeeds. If \a
- * fo is supplied, options are set and cleanup is performed.
+ * fo is supplied, options are set but cleanup must be performed in the caller.
*
* \return File descriptor on success, \p E_MAKESOCK on errors.
*
ret = makesock_addrinfo(l4type, passive, ai, fo);
if (ai)
freeaddrinfo(ai);
- flowopt_cleanup(fo);
if (ret < 0) {
PARA_ERROR_LOG("can not create %s socket %s#%d.\n",
layer4_name(l4type), host? host : (passive?