From 661ac49794a0594003463e1cf3ae1bf806f24213 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 14 Mar 2011 14:49:51 +0100 Subject: s3-epmapper: Added a cleanup function. --- source3/rpc_server/epmapper/srv_epmapper.c | 13 ++++++++++++ source3/rpc_server/epmapper/srv_epmapper.h | 32 ++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 source3/rpc_server/epmapper/srv_epmapper.h (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/epmapper/srv_epmapper.c b/source3/rpc_server/epmapper/srv_epmapper.c index f0bd9c63f5..c43e351fdb 100644 --- a/source3/rpc_server/epmapper/srv_epmapper.c +++ b/source3/rpc_server/epmapper/srv_epmapper.c @@ -23,6 +23,7 @@ #include "../libcli/security/security.h" #include "librpc/gen_ndr/ndr_epmapper.h" #include "librpc/gen_ndr/srv_epmapper.h" +#include "srv_epmapper.h" typedef uint32_t error_status_t; @@ -219,6 +220,18 @@ static bool is_priviledged_pipe(struct auth_serversupplied_info *info) { return true; } +void srv_epmapper_cleanup(void) +{ + struct dcesrv_endpoint *ep; + + for (ep = endpoint_table; + ep != NULL; + ep = endpoint_table) { + DLIST_REMOVE(endpoint_table, ep); + TALLOC_FREE(ep); + } +} + /* * epm_Insert * diff --git a/source3/rpc_server/epmapper/srv_epmapper.h b/source3/rpc_server/epmapper/srv_epmapper.h new file mode 100644 index 0000000000..642117beab --- /dev/null +++ b/source3/rpc_server/epmapper/srv_epmapper.h @@ -0,0 +1,32 @@ +/* + * Unix SMB/CIFS implementation. + * + * Endpoint server for the epmapper pipe + * + * Copyright (C) 2010-2011 Andreas Schneider + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _SRV_EPMAPPER_H_ +#define _SRV_EPMAPPER_H_ + +/** + * @brief Cleanup memory and other stuff. + */ +void srv_epmapper_cleanup(void); + +#endif /*_SRV_EPMAPPER_H_ */ + +/* vim: set ts=8 sw=8 noet cindent syntax=c.doxygen: */ -- cgit