diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-24 15:23:26 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-24 15:23:26 +0000 |
commit | 6c12035a999135fc06fdea5b6eb6f49b86c4b949 (patch) | |
tree | a67f7841b40bf39a09ee6b744c166d6372476ff6 /omfwd.c | |
parent | 6d231d5f159703bb13a2505e6de6c820a3ca05bc (diff) | |
download | rsyslog-6c12035a999135fc06fdea5b6eb6f49b86c4b949.tar.gz rsyslog-6c12035a999135fc06fdea5b6eb6f49b86c4b949.tar.xz rsyslog-6c12035a999135fc06fdea5b6eb6f49b86c4b949.zip |
added freeInstance() call to output module interface; re-structured
ressource release code in syslogd.c
Diffstat (limited to 'omfwd.c')
-rw-r--r-- | omfwd.c | 25 |
1 files changed, 22 insertions, 3 deletions
@@ -442,6 +442,25 @@ static rsRetVal parseSelectorAct(uchar **pp, selector_t *f) return iRet; } +/* free an instance + */ +static rsRetVal freeInstance(selector_t *f) +{ + assert(f != NULL); + 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); + break; + } + return RS_RET_OK; +} + + /* query an entry point */ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)()) @@ -456,9 +475,9 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)()) *pEtryPoint = parseSelectorAct; } else if(!strcmp((char*) name, "isCompatibleWithFeature")) { *pEtryPoint = isCompatibleWithFeature; - } /*else if(!strcmp((char*) name, "freeInstance")) { - *pEtryPoint = freeInstanceFile; - }*/ + } else if(!strcmp((char*) name, "freeInstance")) { + *pEtryPoint = freeInstance; + } return(*pEtryPoint == NULL) ? RS_RET_NOT_FOUND : RS_RET_OK; } |