|
@@ -138,7 +138,7 @@ static int corosync_main_config_format_set (
|
|
|
const char *error_reason;
|
|
const char *error_reason;
|
|
|
char new_format_buffer[PATH_MAX];
|
|
char new_format_buffer[PATH_MAX];
|
|
|
char *value = NULL;
|
|
char *value = NULL;
|
|
|
- cs_error_t err;
|
|
|
|
|
|
|
+ int err = 0;
|
|
|
|
|
|
|
|
if (icmap_get_string("logging.fileline", &value) == CS_OK) {
|
|
if (icmap_get_string("logging.fileline", &value) == CS_OK) {
|
|
|
if (strcmp (value, "on") == 0) {
|
|
if (strcmp (value, "on") == 0) {
|
|
@@ -163,6 +163,11 @@ static int corosync_main_config_format_set (
|
|
|
free(value);
|
|
free(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ error_reason = "not enough memory to set logging format buffer";
|
|
|
|
|
+ goto parse_error;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (icmap_get_string("logging.function_name", &value) == CS_OK) {
|
|
if (icmap_get_string("logging.function_name", &value) == CS_OK) {
|
|
|
if (strcmp (value, "on") == 0) {
|
|
if (strcmp (value, "on") == 0) {
|
|
|
if (!insert_into_buffer(new_format_buffer,
|
|
if (!insert_into_buffer(new_format_buffer,
|
|
@@ -186,6 +191,11 @@ static int corosync_main_config_format_set (
|
|
|
free(value);
|
|
free(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ error_reason = "not enough memory to set logging format buffer";
|
|
|
|
|
+ goto parse_error;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (icmap_get_string("logging.timestamp", &value) == CS_OK) {
|
|
if (icmap_get_string("logging.timestamp", &value) == CS_OK) {
|
|
|
if (strcmp (value, "on") == 0) {
|
|
if (strcmp (value, "on") == 0) {
|
|
|
if(!insert_into_buffer(new_format_buffer,
|
|
if(!insert_into_buffer(new_format_buffer,
|
|
@@ -204,6 +214,11 @@ static int corosync_main_config_format_set (
|
|
|
free(value);
|
|
free(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ error_reason = "not enough memory to set logging format buffer";
|
|
|
|
|
+ goto parse_error;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return (0);
|
|
return (0);
|
|
|
|
|
|
|
|
parse_error:
|
|
parse_error:
|