summaryrefslogtreecommitdiffstats
path: root/msg.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-09-11 15:39:00 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-09-11 15:39:00 +0000
commite114e0d7e5c2df006fc89d8625274da099327e2e (patch)
tree386f5c994f49e99bd542a1d394de3e044e5e2dde /msg.c
parenta24e10de791b69b0904b29b0e84bed53c5dc99b9 (diff)
downloadrsyslog-e114e0d7e5c2df006fc89d8625274da099327e2e.tar.gz
rsyslog-e114e0d7e5c2df006fc89d8625274da099327e2e.tar.xz
rsyslog-e114e0d7e5c2df006fc89d8625274da099327e2e.zip
- removed compiler warnings in non-debug modev1-19-6b
- fixed a bug that caused the CStr class to not honor the parameter to return NULL on empty string - causes a mem leak and can create favourable environment for other bugs (as it leads to empty hostnames)
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/msg.c b/msg.c
index 70234ec9..20480201 100644
--- a/msg.c
+++ b/msg.c
@@ -1560,7 +1560,7 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
* This was found and fixed by varmojefkoj on 2007-09-11
*/
if(pTpe->data.field.options.bDropCC) {
- int iLen = 0;
+ int iLenBuf = 0;
char *pSrc = pRes;
char *pDstStart;
char *pDst;
@@ -1568,13 +1568,13 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
while(*pSrc) {
if(!iscntrl((int) *pSrc++))
- iLen++;
+ iLenBuf++;
else
bDropped = 1;
}
if(bDropped) {
- pDst = pDstStart = malloc(iLen + 1);
+ pDst = pDstStart = malloc(iLenBuf + 1);
if(pDst == NULL) {
if(*pbMustBeFreed == 1)
free(pRes);
@@ -1678,7 +1678,7 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
*/
if(pTpe->data.field.options.bSecPathDrop || pTpe->data.field.options.bSecPathReplace) {
if(pTpe->data.field.options.bSecPathDrop) {
- int iLen = 0;
+ int iLenBuf = 0;
char *pSrc = pRes;
char *pDstStart;
char *pDst;
@@ -1686,13 +1686,13 @@ char *MsgGetProp(msg_t *pMsg, struct templateEntry *pTpe,
while(*pSrc) {
if(*pSrc++ != '/')
- iLen++;
+ iLenBuf++;
else
bDropped = 1;
}
if(bDropped) {
- pDst = pDstStart = malloc(iLen + 1);
+ pDst = pDstStart = malloc(iLenBuf + 1);
if(pDst == NULL) {
if(*pbMustBeFreed == 1)
free(pRes);