summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/syslogd.c b/syslogd.c
index d7d2e0db..3b717f22 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -1038,7 +1038,7 @@ int TCPSend(struct filed *f, char *msg)
if((*(msg+len-1) != '\n')) {
if(buf != NULL)
free(buf);
- if((buf = malloc((len + 1) * sizeof(char))) == NULL) {
+ if((buf = malloc((len + 2) * sizeof(char))) == NULL) {
/* extreme mem shortage, try to solve
* as good as we can. No point in calling
* any alarms, they might as well run out
@@ -4274,7 +4274,8 @@ void die(sig)
free(f->f_iov);
}
/* Now delete cached messages */
- MsgDestruct(f->f_pMsg);
+ if(f->f_pMsg != NULL)
+ MsgDestruct(f->f_pMsg);
#ifdef WITH_DB
if (f->f_type == F_MYSQL)
closeMySQL(f);