diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-24 09:51:55 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-24 09:51:55 +0000 |
commit | f1e14aefde8c295a2cbd93b9118d32961b6c373f (patch) | |
tree | 54d240a5253bb530b2b93c8752bce43d74d1c8db /syslogd.c | |
parent | f97c90d12b9ae64a64cde84bb3fa3ca5ee207838 (diff) | |
download | rsyslog-f1e14aefde8c295a2cbd93b9118d32961b6c373f.tar.gz rsyslog-f1e14aefde8c295a2cbd93b9118d32961b6c373f.tar.bz2 rsyslog-f1e14aefde8c295a2cbd93b9118d32961b6c373f.zip |
applied patch from varmojfekoj to solve small mem leak
Diffstat (limited to 'syslogd.c')
-rw-r--r-- | syslogd.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -3529,6 +3529,19 @@ static void die(int sig) if (f->f_type == F_MYSQL) closeMySQL(f); #endif + switch (f->f_type) { + case F_FORW: + case F_FORW_SUSP: + freeaddrinfo(f->f_un.f_forw.f_addr); + /* fall through */ + case F_FORW_UNKN: + if (f->f_un.f_forw.port != NULL) + free(f->f_un.f_forw.port); + } + + if (f->f_psziov != NULL) + free(f->f_psziov); + fPrev = f; f = f->f_next; free(fPrev); @@ -4219,6 +4232,10 @@ static void init() free(f->f_iov); } + /* free iov string */ + if (f->f_psziov != NULL) + free(f->f_psziov); + switch (f->f_type) { case F_FILE: case F_PIPE: @@ -4227,7 +4244,10 @@ static void init() freeInstanceFile(f); break; case F_FORW: + case F_FORW_SUSP: freeaddrinfo(f->f_un.f_forw.f_addr); + /* fall through */ + case F_FORW_UNKN: if(f->f_un.f_forw.port != NULL) free(f->f_un.f_forw.port); break; |