X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Fdsi%2Fdsi_tcp.c;h=f73147a81a9565309bcbe518042edf1f6865e106;hb=1c6730bd451c9531bb9b91d59e14e51f80d6dd67;hp=e06e87d92420187948611b9d044995ab158065c6;hpb=8e5e83dac34cf886996821a51dee5c971e7c51f2;p=netatalk.git diff --git a/libatalk/dsi/dsi_tcp.c b/libatalk/dsi/dsi_tcp.c index e06e87d9..f73147a8 100644 --- a/libatalk/dsi/dsi_tcp.c +++ b/libatalk/dsi/dsi_tcp.c @@ -103,9 +103,29 @@ static void dsi_init_buffer(DSI *dsi) dsi->end = dsi->buffer + (dsi->dsireadbuf * dsi->server_quantum); } +/*! + * Free any allocated ressources of the master afpd DSI objects and close server socket + */ +void dsi_free(DSI *dsi) +{ + close(dsi->serversock); + dsi->serversock = -1; + + free(dsi->commands); + dsi->commands = NULL; + + free(dsi->buffer); + dsi->buffer = NULL; + +#ifdef USE_ZEROCONF + free(dsi->bonjourname); + dsi->bonjourname = NULL; +#endif +} + static struct itimerval itimer; /* accept the socket and do a little sanity checking */ -static int dsi_tcp_open(DSI *dsi) +static pid_t dsi_tcp_open(DSI *dsi) { pid_t pid; SOCKLEN_T len;