diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-17 00:00:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-17 00:00:49 +0300 |
commit | e55bffb6b075d115b4bab7f5aeb2dbdeec512c9f (patch) | |
tree | 4499333ba209bb27258158d913e52673a5cb7d50 /src/login | |
parent | 4722e3efccbfd81280a78aca717f91f99a4c5747 (diff) | |
download | evol-hercules-e55bffb6b075d115b4bab7f5aeb2dbdeec512c9f.tar.gz evol-hercules-e55bffb6b075d115b4bab7f5aeb2dbdeec512c9f.tar.bz2 evol-hercules-e55bffb6b075d115b4bab7f5aeb2dbdeec512c9f.tar.xz evol-hercules-e55bffb6b075d115b4bab7f5aeb2dbdeec512c9f.zip |
login: fix memory leak on exit.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/config.c | 6 | ||||
-rw-r--r-- | src/login/config.h | 1 | ||||
-rw-r--r-- | src/login/init.c | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/login/config.c b/src/login/config.c index e6a1a42..d53cd17 100644 --- a/src/login/config.c +++ b/src/login/config.c @@ -19,3 +19,9 @@ void config_update_server(const char *val) { update_server = aStrdup(val); } + +void config_final(void) +{ + if (update_server) + aFree(update_server); +} diff --git a/src/login/config.h b/src/login/config.h index 1777a9b..a491e1e 100644 --- a/src/login/config.h +++ b/src/login/config.h @@ -5,6 +5,7 @@ #define EVOL_LOGIN_CONFIG void config_update_server(const char *val); +void config_final(void); extern char *update_server; diff --git a/src/login/init.c b/src/login/init.c index 03bc2e6..b1682af 100644 --- a/src/login/init.c +++ b/src/login/init.c @@ -49,4 +49,5 @@ HPExport void server_online (void) HPExport void plugin_final (void) { + config_final(); } |