Diff between 628add0e5c4bdbeaa4ac7c9f87148330dfe2d48d and 72c491eb405a47d7380a8cb12a78db92927ff9d2

Changed Files

File Additions Deletions Status
src/main.c +15 -0 modified

Full Patch

diff --git a/src/main.c b/src/main.c
index ccb5fa5..bc53a8e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -344,6 +344,18 @@ static gboolean option_detach = TRUE;
 static gboolean option_version = FALSE;
 static gboolean option_udev = FALSE;
 
+static void free_options(void)
+{
+	g_free(option_debug);
+	option_debug = NULL;
+
+	g_free(option_plugin);
+	option_plugin = NULL;
+
+	g_free(option_noplugin);
+	option_noplugin = NULL;
+}
+
 static guint last_adapter_timeout = 0;
 
 static gboolean exit_timeout(gpointer data)
@@ -533,6 +545,9 @@ int main(int argc, char *argv[])
 	 * daemon needs to be re-worked. */
 	plugin_init(config, option_plugin, option_noplugin);
 
+	/* no need to keep parsed option in memory */
+	free_options();
+
 	mgmt_err = mgmt_setup();
 	if (mgmt_err < 0) {
 		error("mgmt setup failed: %s", strerror(-mgmt_err));