summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-12-05 23:57:28 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-12-05 23:59:59 +0100
commitf4805d70cc4514b2569f8864ac138b5b21409cbc (patch)
tree378f7b232ff0b702340093c57ea24453d6f576a8 /plugin
parent5d3865f83985e5d827e2b294841daa0219c2388a (diff)
downloadeurephia-f4805d70cc4514b2569f8864ac138b5b21409cbc.tar.gz
eurephia-f4805d70cc4514b2569f8864ac138b5b21409cbc.tar.xz
eurephia-f4805d70cc4514b2569f8864ac138b5b21409cbc.zip
Fixed memory leak in eurephiaInit()
This memory leak got introduced with commit 525d75316848f79208101e48a54e2 which moves the daemonisation of the firewall thread. Two environment variables was not freed after usage. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'plugin')
-rw-r--r--plugin/eurephia.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugin/eurephia.c b/plugin/eurephia.c
index fad7117..71181f5 100644
--- a/plugin/eurephia.c
+++ b/plugin/eurephia.c
@@ -187,13 +187,15 @@ eurephiaCTX *eurephiaInit(const char const **argv, const char const **envp)
fwintf = eGet_value(ctx->dbc->config, "firewall_interface");
if( fwintf != NULL ) {
if( eFW_load(ctx, fwintf) ) {
- const char *daemon_s = GETENV_DAEMON(envp);
- const char *logredir_s = GETENV_DAEMONLOGREDIR(envp);
+ char *daemon_s = GETENV_DAEMON(envp);
+ char *logredir_s = GETENV_DAEMONLOGREDIR(envp);
eurephia_log(ctx, LOG_INFO, 0, "Loaded firewall interface: %s", fwintf);
eFW_StartFirewall(ctx,
(daemon_s && (daemon_s[0] == '1')),
(logredir_s && logredir_s[0] == '1'));
+ free_nullsafe(ctx, daemon_s);
+ free_nullsafe(ctx, logredir_s);
} else {
eurephia_log(ctx, LOG_FATAL, 0, "Loading of firewall interface failed (%s)", fwintf);
ctx->eurephia_fw_intf = NULL;