mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-10-04 18:19:35 +00:00
Do not dereference format_buffer when it's NULL
Signed-off-by: Jan Friesse <jfriesse@redhat.com> Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
This commit is contained in:
parent
96a89a0085
commit
d5d3fb4d45
@ -569,7 +569,6 @@ logsys_file_format_get(char* file_format, int buf_len)
|
||||
|
||||
int logsys_format_set (const char *format)
|
||||
{
|
||||
int ret = 0;
|
||||
int i;
|
||||
int c;
|
||||
int w;
|
||||
@ -584,8 +583,9 @@ int logsys_format_set (const char *format)
|
||||
|
||||
format_buffer = strdup(format ? format : "%7p [%6g] %b");
|
||||
if (format_buffer == NULL) {
|
||||
ret = -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
qb_log_format_set(QB_LOG_STDERR, format_buffer);
|
||||
|
||||
logsys_file_format_get(file_format, 128);
|
||||
@ -622,7 +622,7 @@ int logsys_format_set (const char *format)
|
||||
}
|
||||
qb_log_format_set(QB_LOG_SYSLOG, syslog_format);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *logsys_format_get (void)
|
||||
|
Loading…
Reference in New Issue
Block a user