diff options
Diffstat (limited to 'proxy/src')
-rw-r--r-- | proxy/src/gp_config.c | 24 | ||||
-rw-r--r-- | proxy/src/gp_proxy.h | 1 | ||||
-rw-r--r-- | proxy/src/gssproxy.c | 2 |
3 files changed, 27 insertions, 0 deletions
diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c index 0e81de6..6776ed5 100644 --- a/proxy/src/gp_config.c +++ b/proxy/src/gp_config.c @@ -404,3 +404,27 @@ struct gp_ring_buffer *gp_service_get_ring_buffer(struct gp_service *svc) { return svc->ring_buffer; } + +void free_config(struct gp_config *config) +{ + uint32_t i; + + if (!config) { + return; + } + + free(config->config_file); + free(config->socket_name); + + for (i=0; i < config->num_svcs; i++) { + gp_service_free(config->svcs[i]); + } + + free(config->svcs); + + for (i=0; i < config->num_ring_buffers; i++) { + gp_free_ring_buffer(config->ring_buffers[i]); + } + + free(config->ring_buffers); +} diff --git a/proxy/src/gp_proxy.h b/proxy/src/gp_proxy.h index ee93258..3d52cfe 100644 --- a/proxy/src/gp_proxy.h +++ b/proxy/src/gp_proxy.h @@ -83,6 +83,7 @@ struct gp_conn; /* from gp_config.c */ struct gp_config *read_config(char *config_file, int opt_daemonize); struct gp_ring_buffer *gp_service_get_ring_buffer(struct gp_service *svc); +void free_config(struct gp_config *config); /* from gp_init.c */ void init_server(bool daemonize); diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c index 14f223f..498ee59 100644 --- a/proxy/src/gssproxy.c +++ b/proxy/src/gssproxy.c @@ -129,5 +129,7 @@ int main(int argc, const char *argv[]) poptFreeContext(pc); + free_config(gpctx->config); + return 0; } |