* avoid memory leaks
* don't use incomplete or header after free()
Signed-off-by: Karel Zak <kzak@redhat.com>
char pid[30], *hostname;
*pid = '\0';
- if (ctl->fd < 0)
- return;
if (ctl->pid)
snprintf(pid, sizeof(pid), "[%d]", ctl->pid);
char *structured = NULL;
struct list_head *sd;
- if (ctl->fd < 0)
- return;
-
if (ctl->rfc5424_time) {
struct timeval tv;
struct tm *tm;
static void generate_syslog_header(struct logger_ctl *const ctl)
{
free(ctl->hdr);
+ ctl->hdr = NULL;
ctl->syslogfp(ctl);
}