Code

sysdbd: Added daemon_free_listen_addresses().
authorSebastian Harl <sh@tokkee.org>
Mon, 21 Apr 2014 17:38:38 +0000 (19:38 +0200)
committerSebastian Harl <sh@tokkee.org>
Mon, 21 Apr 2014 17:38:38 +0000 (19:38 +0200)
This is a helper function for handling config settings.

src/tools/sysdbd/configfile.c
src/tools/sysdbd/configfile.h

index 9e918d5c7f40af750929ed9a51d12238eae42971..5a36c22dbda222e4cdd8c923d604b4f09efa5ad8 100644 (file)
@@ -250,6 +250,22 @@ static token_parser_t token_parser_list[] = {
  * public API
  */
 
+void
+daemon_free_listen_addresses(void)
+{
+       size_t i;
+
+       if (! listen_addresses)
+               return;
+
+       for (i = 0; i < listen_addresses_num; ++i)
+               free(listen_addresses[i]);
+       free(listen_addresses);
+
+       listen_addresses = NULL;
+       listen_addresses_num = 0;
+} /* daemon_free_listen_addresses */
+
 int
 daemon_parse_config(const char *filename)
 {
index 19abe9ac55f25f041008c63315c0d828ec9e149c..2d8945c119d2b92890586c6c513711c224fcb357 100644 (file)
@@ -37,6 +37,9 @@
 extern char **listen_addresses;
 extern size_t listen_addresses_num;
 
+void
+daemon_free_listen_addresses(void);
+
 /*
  * daemon_parse_config:
  * Parse the specified configuration file.