X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=send_common.c;fp=send_common.c;h=ea494d9a7b23f5ee87186917d11e883631ec9cbc;hp=24b14ab8ed50b90c956fc6578199f8a4da3f2c4e;hb=4fb6bf35f5dd6bfcafc0b90e83d4d9084da38365;hpb=9569c2194f248a94b4e8e53d21699c1e3a6a11eb diff --git a/send_common.c b/send_common.c index 24b14ab8..ea494d9a 100644 --- a/send_common.c +++ b/send_common.c @@ -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. *