X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=send_common.c;h=9debdfca5a40a7ada404e9cf4a034140e2509a6b;hb=2bad70d84e763b4d866d7b97dbc1cdc8e030bd45;hp=24b14ab8ed50b90c956fc6578199f8a4da3f2c4e;hpb=f787a626b8885247948e3c47ae886b1e3a7c2a3a;p=paraslash.git diff --git a/send_common.c b/send_common.c index 24b14ab8..9debdfca 100644 --- a/send_common.c +++ b/send_common.c @@ -136,9 +136,9 @@ void init_sender_status(struct sender_status *ss, } ss->default_port = default_port; - INIT_LIST_HEAD(&ss->client_list); + init_list_head(&ss->client_list); /* Initialize an access control list */ - INIT_LIST_HEAD(&ss->acl); + init_list_head(&ss->acl); for (i = 0; i < lls_opt_given(acl_opt_result); i++) { const char *arg = lls_string_val(i, acl_opt_result); char addr[16]; @@ -154,6 +154,25 @@ void init_sender_status(struct sender_status *ss, ss->default_deny = default_deny; } +/** + * Deallocate all resources allocated in \ref init_sender_status(). + * + * \param ss The structure whose components should be freed. + * + * This frees the dynamically allocated parts of the structure which was + * initialized by an earlier call to \ref init_sender_status(). It does *not* + * call free(ss), though. + */ +void free_sender_status(const struct sender_status *ss) +{ + int i; + + free(ss->listen_fds); + FOR_EACH_LISTEN_FD(i, ss) + free(ss->listen_addresses[i]); + free(ss->listen_addresses); +} + /** * Return a string containing the current status of a sender. *