diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2010-12-05 23:57:28 +0100 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2010-12-05 23:59:59 +0100 |
commit | f4805d70cc4514b2569f8864ac138b5b21409cbc (patch) | |
tree | 378f7b232ff0b702340093c57ea24453d6f576a8 | |
parent | 5d3865f83985e5d827e2b294841daa0219c2388a (diff) | |
download | eurephia-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>
-rw-r--r-- | plugin/eurephia.c | 6 |
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; |