summaryrefslogtreecommitdiff
path: root/plugins/omrelp
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-07-23 02:22:26 +0200
committerMichael Biebl <biebl@debian.org>2008-07-23 02:22:26 +0200
commita0a154c1e0b88afbe3cabc2a5a4d3a4523681576 (patch)
tree8ab4f9d7e06b45a9874c0d5ad25223de133ef206 /plugins/omrelp
parent991c6cc7f1b1586b3fad07460503bb9f7a34ad07 (diff)
downloadrsyslog-a0a154c1e0b88afbe3cabc2a5a4d3a4523681576.tar.gz
Imported Upstream version 3.18.1upstream/3.18.1
Diffstat (limited to 'plugins/omrelp')
-rw-r--r--plugins/omrelp/omrelp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
index 39d2581..0457168 100644
--- a/plugins/omrelp/omrelp.c
+++ b/plugins/omrelp/omrelp.c
@@ -53,7 +53,7 @@ DEFobjCurrIf(errmsg)
static relpEngine_t *pRelpEngine; /* our relp engine */
typedef struct _instanceData {
- char f_hname[MAXHOSTNAMELEN+1];
+ char *f_hname;
int compressionLevel; /* 0 - no compression, else level for zlib */
char *port;
int bInitialConnect; /* is this the initial connection request of our module? (0-no, 1-yes) */
@@ -98,6 +98,9 @@ CODESTARTfreeInstance
if(pData->pRelpClt != NULL)
relpEngineCltDestruct(pRelpEngine, &pData->pRelpClt);
+ if(pData->f_hname != NULL)
+ free(pData->f_hname);
+
ENDfreeInstance
@@ -284,10 +287,11 @@ CODE_STD_STRING_REQUESTparseSelectorAct(1)
/* TODO: make this if go away! */
if(*p == ';') {
*p = '\0'; /* trick to obtain hostname (later)! */
- strcpy(pData->f_hname, (char*) q);
+ CHKmalloc(pData->f_hname = strdup((char*) q));
*p = ';';
- } else
- strcpy(pData->f_hname, (char*) q);
+ } else {
+ CHKmalloc(pData->f_hname = strdup((char*) q));
+ }
/* process template */
CHKiRet(cflineParseTemplateName(&p, *ppOMSR, 0, OMSR_NO_RQD_TPL_OPTS, (uchar*) "RSYSLOG_ForwardFormat"));