|
|
1f016a |
diff --git a/GNUmakefile b/GNUmakefile
|
|
|
1f016a |
index f28dea8..7a4c929 100644
|
|
|
1f016a |
--- a/GNUmakefile
|
|
|
1f016a |
+++ b/GNUmakefile
|
|
|
1f016a |
@@ -325,7 +325,7 @@ clang:
|
|
|
1f016a |
test -e $(CLANG_analyzer)
|
|
|
1f016a |
scan-build $(CLANG_checkers:%=-enable-checker %) make
|
|
|
1f016a |
|
|
|
1f016a |
-# V3 = scandir unsetenv alphasort
|
|
|
1f016a |
+# V3 = scandir unsetenv alphasort xalloc
|
|
|
1f016a |
# V2 = setenv strerror strchrnul strndup
|
|
|
1f016a |
# http://www.gnu.org/software/gnulib/manual/html_node/Initial-import.html#Initial-import
|
|
|
1f016a |
GNU_MODS = crypto/md5
|
|
|
1f016a |
diff --git a/crmd/lrm.c b/crmd/lrm.c
|
|
|
1f016a |
index b68f657..8315f6f 100644
|
|
|
1f016a |
--- a/crmd/lrm.c
|
|
|
1f016a |
+++ b/crmd/lrm.c
|
|
|
1f016a |
@@ -630,7 +630,7 @@ append_restart_list(lrmd_rsc_info_t * rsc, lrmd_event_data_t * op, xmlNode * upd
|
|
|
1f016a |
crm_xml_add(restart, param, value);
|
|
|
1f016a |
}
|
|
|
1f016a |
len += strlen(param) + 2;
|
|
|
1f016a |
- list = realloc(list, len + 1);
|
|
|
1f016a |
+ list = realloc_safe(list, len + 1);
|
|
|
1f016a |
sprintf(list + start, " %s ", param);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
diff --git a/cts/CIB.py b/cts/CIB.py
|
|
|
1f016a |
index d26efdb..7922d8b 100644
|
|
|
1f016a |
--- a/cts/CIB.py
|
|
|
1f016a |
+++ b/cts/CIB.py
|
|
|
1f016a |
@@ -298,7 +298,28 @@ class CIB11(ConfigBase):
|
|
|
1f016a |
# Group Resource
|
|
|
1f016a |
g = Group(self.Factory, "group-1")
|
|
|
1f016a |
g.add_child(self.NewIP())
|
|
|
1f016a |
- g.add_child(self.NewIP())
|
|
|
1f016a |
+
|
|
|
1f016a |
+ if self.CM.Env["have_systemd"]:
|
|
|
1f016a |
+ dummy_service_file = """
|
|
|
1f016a |
+[Unit]
|
|
|
1f016a |
+Description=Dummy resource that takes a while to start
|
|
|
1f016a |
+
|
|
|
1f016a |
+[Service]
|
|
|
1f016a |
+Type=notify
|
|
|
1f016a |
+ExecStart=/usr/bin/python -c 'import time; import systemd.daemon;time.sleep(10); systemd.daemon.notify("READY=1"); time.sleep(3600)'
|
|
|
1f016a |
+ExecStop=sleep 10
|
|
|
1f016a |
+ExecStop=/bin/kill -KILL $MAINPID
|
|
|
1f016a |
+"""
|
|
|
1f016a |
+
|
|
|
1f016a |
+ os.system("cat <<-END >/tmp/DummySD.service\n%s\nEND" % (dummy_service_file))
|
|
|
1f016a |
+
|
|
|
1f016a |
+ self.CM.install_helper("DummySD.service", destdir="/usr/lib/systemd/system/", sourcedir="/tmp")
|
|
|
1f016a |
+ sysd = Resource(self.Factory, "petulant", "DummySD", "service")
|
|
|
1f016a |
+ sysd.add_op("monitor", "P10S")
|
|
|
1f016a |
+ g.add_child(sysd)
|
|
|
1f016a |
+ else:
|
|
|
1f016a |
+ g.add_child(self.NewIP())
|
|
|
1f016a |
+
|
|
|
1f016a |
g.add_child(self.NewIP())
|
|
|
1f016a |
|
|
|
1f016a |
# Group with the master
|
|
|
1f016a |
diff --git a/cts/environment.py b/cts/environment.py
|
|
|
1f016a |
index d741452..2b2a343 100644
|
|
|
1f016a |
--- a/cts/environment.py
|
|
|
1f016a |
+++ b/cts/environment.py
|
|
|
1f016a |
@@ -283,9 +283,9 @@ class Environment:
|
|
|
1f016a |
break;
|
|
|
1f016a |
self["cts-master"] = master
|
|
|
1f016a |
|
|
|
1f016a |
- if self.has_key("have_systemd"):
|
|
|
1f016a |
- self["have_systemd"] = not rsh(discover, "systemctl list-units")
|
|
|
1f016a |
-
|
|
|
1f016a |
+ if not self.has_key("have_systemd"):
|
|
|
1f016a |
+ self["have_systemd"] = not self.rsh(self.target, "systemctl list-units")
|
|
|
1f016a |
+
|
|
|
1f016a |
self.detect_syslog()
|
|
|
1f016a |
self.detect_at_boot()
|
|
|
1f016a |
self.detect_ip_offset()
|
|
|
1f016a |
diff --git a/fencing/standalone_config.c b/fencing/standalone_config.c
|
|
|
1f016a |
index 01c22b6..4319c4a 100644
|
|
|
1f016a |
--- a/fencing/standalone_config.c
|
|
|
1f016a |
+++ b/fencing/standalone_config.c
|
|
|
1f016a |
@@ -170,7 +170,7 @@ standalone_cfg_add_node(const char *node, const char *device, const char *ports)
|
|
|
1f016a |
|
|
|
1f016a |
if (tmp) {
|
|
|
1f016a |
offset = strlen(tmp);
|
|
|
1f016a |
- tmp = realloc(tmp, len + offset + 1);
|
|
|
1f016a |
+ tmp = realloc_safe(tmp, len + offset + 1);
|
|
|
1f016a |
} else {
|
|
|
1f016a |
tmp = malloc(len);
|
|
|
1f016a |
}
|
|
|
1f016a |
diff --git a/include/crm_internal.h b/include/crm_internal.h
|
|
|
1f016a |
index 3eb88de..169d6d3 100644
|
|
|
1f016a |
--- a/include/crm_internal.h
|
|
|
1f016a |
+++ b/include/crm_internal.h
|
|
|
1f016a |
@@ -341,4 +341,16 @@ void cib_ipc_servers_destroy(qb_ipcs_service_t *ipcs_ro,
|
|
|
1f016a |
qb_ipcs_service_t *ipcs_rw,
|
|
|
1f016a |
qb_ipcs_service_t *ipcs_shm);
|
|
|
1f016a |
|
|
|
1f016a |
+static inline void *realloc_safe(void *ptr, size_t size)
|
|
|
1f016a |
+{
|
|
|
1f016a |
+ void *ret = realloc(ptr, size);
|
|
|
1f016a |
+
|
|
|
1f016a |
+ if(ret == NULL) {
|
|
|
1f016a |
+ abort();
|
|
|
1f016a |
+ }
|
|
|
1f016a |
+
|
|
|
1f016a |
+ return ret;
|
|
|
1f016a |
+}
|
|
|
1f016a |
+
|
|
|
1f016a |
+
|
|
|
1f016a |
#endif /* CRM_INTERNAL__H */
|
|
|
1f016a |
diff --git a/lib/ais/plugin.c b/lib/ais/plugin.c
|
|
|
1f016a |
index 3d4f369..ab534fa 100644
|
|
|
1f016a |
--- a/lib/ais/plugin.c
|
|
|
1f016a |
+++ b/lib/ais/plugin.c
|
|
|
1f016a |
@@ -1214,7 +1214,7 @@ pcmk_generate_membership_data(void)
|
|
|
1f016a |
|
|
|
1f016a |
g_hash_table_foreach(membership_list, member_loop_fn, &data);
|
|
|
1f016a |
size = strlen(data.string);
|
|
|
1f016a |
- data.string = realloc(data.string, size + 9); /* 9 = </nodes> + nul */
|
|
|
1f016a |
+ data.string = realloc_safe(data.string, size + 9); /* 9 = </nodes> + nul */
|
|
|
1f016a |
sprintf(data.string + size, "</nodes>");
|
|
|
1f016a |
return data.string;
|
|
|
1f016a |
}
|
|
|
1f016a |
diff --git a/lib/ais/utils.c b/lib/ais/utils.c
|
|
|
1f016a |
index e56fb6d..94a2505 100644
|
|
|
1f016a |
--- a/lib/ais/utils.c
|
|
|
1f016a |
+++ b/lib/ais/utils.c
|
|
|
1f016a |
@@ -409,7 +409,7 @@ append_member(char *data, crm_node_t * node)
|
|
|
1f016a |
if (node->version) {
|
|
|
1f016a |
size += (9 + strlen(node->version));
|
|
|
1f016a |
}
|
|
|
1f016a |
- data = realloc(data, size);
|
|
|
1f016a |
+ data = realloc_safe(data, size);
|
|
|
1f016a |
|
|
|
1f016a |
offset += snprintf(data + offset, size - offset, "<node id=\"%u\" ", node->id);
|
|
|
1f016a |
if (node->uname) {
|
|
|
1f016a |
diff --git a/lib/cluster/cpg.c b/lib/cluster/cpg.c
|
|
|
1f016a |
index 6c86e83..cda6326 100644
|
|
|
1f016a |
--- a/lib/cluster/cpg.c
|
|
|
1f016a |
+++ b/lib/cluster/cpg.c
|
|
|
1f016a |
@@ -584,7 +584,7 @@ send_cluster_text(int class, const char *data,
|
|
|
1f016a |
msg->header.size = sizeof(AIS_Message) + msg->size;
|
|
|
1f016a |
|
|
|
1f016a |
if (msg->size < CRM_BZ2_THRESHOLD) {
|
|
|
1f016a |
- msg = realloc(msg, msg->header.size);
|
|
|
1f016a |
+ msg = realloc_safe(msg, msg->header.size);
|
|
|
1f016a |
memcpy(msg->data, data, msg->size);
|
|
|
1f016a |
|
|
|
1f016a |
} else {
|
|
|
1f016a |
@@ -595,14 +595,14 @@ send_cluster_text(int class, const char *data,
|
|
|
1f016a |
if (crm_compress_string(uncompressed, msg->size, 0, &compressed, &new_size)) {
|
|
|
1f016a |
|
|
|
1f016a |
msg->header.size = sizeof(AIS_Message) + new_size;
|
|
|
1f016a |
- msg = realloc(msg, msg->header.size);
|
|
|
1f016a |
+ msg = realloc_safe(msg, msg->header.size);
|
|
|
1f016a |
memcpy(msg->data, compressed, new_size);
|
|
|
1f016a |
|
|
|
1f016a |
msg->is_compressed = TRUE;
|
|
|
1f016a |
msg->compressed_size = new_size;
|
|
|
1f016a |
|
|
|
1f016a |
} else {
|
|
|
1f016a |
- msg = realloc(msg, msg->header.size);
|
|
|
1f016a |
+ msg = realloc_safe(msg, msg->header.size);
|
|
|
1f016a |
memcpy(msg->data, data, msg->size);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
diff --git a/lib/cluster/heartbeat.c b/lib/cluster/heartbeat.c
|
|
|
1f016a |
index a801c8e..6f6a388 100644
|
|
|
1f016a |
--- a/lib/cluster/heartbeat.c
|
|
|
1f016a |
+++ b/lib/cluster/heartbeat.c
|
|
|
1f016a |
@@ -106,7 +106,7 @@ convert_ha_field(xmlNode * parent, void *msg_v, int lpc)
|
|
|
1f016a |
|
|
|
1f016a |
crm_trace("Trying to decompress %d bytes", (int)orig_len);
|
|
|
1f016a |
retry:
|
|
|
1f016a |
- uncompressed = realloc(uncompressed, size);
|
|
|
1f016a |
+ uncompressed = realloc_safe(uncompressed, size);
|
|
|
1f016a |
memset(uncompressed, 0, size);
|
|
|
1f016a |
used = size - 1; /* always leave room for a trailing '\0'
|
|
|
1f016a |
* BZ2_bzBuffToBuffDecompress wont say anything if
|
|
|
1f016a |
diff --git a/lib/common/logging.c b/lib/common/logging.c
|
|
|
1f016a |
index d64b77a..f211d80 100644
|
|
|
1f016a |
--- a/lib/common/logging.c
|
|
|
1f016a |
+++ b/lib/common/logging.c
|
|
|
1f016a |
@@ -956,7 +956,7 @@ crm_log_args(int argc, char **argv)
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
len = 2 + strlen(argv[lpc]); /* +1 space, +1 EOS */
|
|
|
1f016a |
- arg_string = realloc(arg_string, len + existing_len);
|
|
|
1f016a |
+ arg_string = realloc_safe(arg_string, len + existing_len);
|
|
|
1f016a |
existing_len += sprintf(arg_string + existing_len, "%s ", argv[lpc]);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
diff --git a/lib/common/remote.c b/lib/common/remote.c
|
|
|
1f016a |
index f11ebcd..2a5b449 100644
|
|
|
1f016a |
--- a/lib/common/remote.c
|
|
|
1f016a |
+++ b/lib/common/remote.c
|
|
|
1f016a |
@@ -520,7 +520,7 @@ crm_remote_recv_once(crm_remote_t * remote)
|
|
|
1f016a |
remote->buffer_size = 2 * read_len;
|
|
|
1f016a |
crm_trace("Expanding buffer to %u bytes", remote->buffer_size);
|
|
|
1f016a |
|
|
|
1f016a |
- remote->buffer = realloc(remote->buffer, remote->buffer_size + 1);
|
|
|
1f016a |
+ remote->buffer = realloc_safe(remote->buffer, remote->buffer_size + 1);
|
|
|
1f016a |
CRM_ASSERT(remote->buffer != NULL);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
diff --git a/lib/common/utils.c b/lib/common/utils.c
|
|
|
1f016a |
index eacd8e9..d70778d 100644
|
|
|
1f016a |
--- a/lib/common/utils.c
|
|
|
1f016a |
+++ b/lib/common/utils.c
|
|
|
1f016a |
@@ -1712,7 +1712,7 @@ crm_create_long_opts(struct crm_option *long_options)
|
|
|
1f016a |
* This dummy entry allows us to differentiate between the two in crm_get_option()
|
|
|
1f016a |
* and exit with the correct error code
|
|
|
1f016a |
*/
|
|
|
1f016a |
- long_opts = realloc(long_opts, (index + 1) * sizeof(struct option));
|
|
|
1f016a |
+ long_opts = realloc_safe(long_opts, (index + 1) * sizeof(struct option));
|
|
|
1f016a |
long_opts[index].name = "__dummmy__";
|
|
|
1f016a |
long_opts[index].has_arg = 0;
|
|
|
1f016a |
long_opts[index].flag = 0;
|
|
|
1f016a |
@@ -1724,7 +1724,7 @@ crm_create_long_opts(struct crm_option *long_options)
|
|
|
1f016a |
continue;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
- long_opts = realloc(long_opts, (index + 1) * sizeof(struct option));
|
|
|
1f016a |
+ long_opts = realloc_safe(long_opts, (index + 1) * sizeof(struct option));
|
|
|
1f016a |
/*fprintf(stderr, "Creating %d %s = %c\n", index,
|
|
|
1f016a |
* long_options[lpc].name, long_options[lpc].val); */
|
|
|
1f016a |
long_opts[index].name = long_options[lpc].name;
|
|
|
1f016a |
@@ -1735,7 +1735,7 @@ crm_create_long_opts(struct crm_option *long_options)
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
/* Now create the list terminator */
|
|
|
1f016a |
- long_opts = realloc(long_opts, (index + 1) * sizeof(struct option));
|
|
|
1f016a |
+ long_opts = realloc_safe(long_opts, (index + 1) * sizeof(struct option));
|
|
|
1f016a |
long_opts[index].name = NULL;
|
|
|
1f016a |
long_opts[index].has_arg = 0;
|
|
|
1f016a |
long_opts[index].flag = 0;
|
|
|
1f016a |
@@ -1759,7 +1759,7 @@ crm_set_options(const char *short_options, const char *app_usage, struct crm_opt
|
|
|
1f016a |
|
|
|
1f016a |
for (lpc = 0; long_options[lpc].name != NULL; lpc++) {
|
|
|
1f016a |
if (long_options[lpc].val && long_options[lpc].val != '-' && long_options[lpc].val < UCHAR_MAX) {
|
|
|
1f016a |
- local_short_options = realloc(local_short_options, opt_string_len + 4);
|
|
|
1f016a |
+ local_short_options = realloc_safe(local_short_options, opt_string_len + 4);
|
|
|
1f016a |
local_short_options[opt_string_len++] = long_options[lpc].val;
|
|
|
1f016a |
/* getopt(3) says: Two colons mean an option takes an optional arg; */
|
|
|
1f016a |
if (long_options[lpc].has_arg == optional_argument) {
|
|
|
1f016a |
@@ -2517,7 +2517,7 @@ add_list_element(char *list, const char *value)
|
|
|
1f016a |
}
|
|
|
1f016a |
len = last + 2; /* +1 space, +1 EOS */
|
|
|
1f016a |
len += strlen(value);
|
|
|
1f016a |
- list = realloc(list, len);
|
|
|
1f016a |
+ list = realloc_safe(list, len);
|
|
|
1f016a |
sprintf(list + last, " %s", value);
|
|
|
1f016a |
return list;
|
|
|
1f016a |
}
|
|
|
1f016a |
diff --git a/lib/common/xml.c b/lib/common/xml.c
|
|
|
1f016a |
index e63a582..0effd47 100644
|
|
|
1f016a |
--- a/lib/common/xml.c
|
|
|
1f016a |
+++ b/lib/common/xml.c
|
|
|
1f016a |
@@ -206,7 +206,7 @@ static inline bool TRACKING_CHANGES(xmlNode *xml)
|
|
|
1f016a |
} else if(rc >= ((max) - (offset))) { \
|
|
|
1f016a |
char *tmp = NULL; \
|
|
|
1f016a |
(max) = QB_MAX(CHUNK_SIZE, (max) * 2); \
|
|
|
1f016a |
- tmp = realloc((buffer), (max) + 1); \
|
|
|
1f016a |
+ tmp = realloc_safe((buffer), (max) + 1); \
|
|
|
1f016a |
CRM_ASSERT(tmp); \
|
|
|
1f016a |
(buffer) = tmp; \
|
|
|
1f016a |
} else { \
|
|
|
1f016a |
@@ -223,7 +223,7 @@ insert_prefix(int options, char **buffer, int *offset, int *max, int depth)
|
|
|
1f016a |
|
|
|
1f016a |
if ((*buffer) == NULL || spaces >= ((*max) - (*offset))) {
|
|
|
1f016a |
(*max) = QB_MAX(CHUNK_SIZE, (*max) * 2);
|
|
|
1f016a |
- (*buffer) = realloc((*buffer), (*max) + 1);
|
|
|
1f016a |
+ (*buffer) = realloc_safe((*buffer), (*max) + 1);
|
|
|
1f016a |
}
|
|
|
1f016a |
memset((*buffer) + (*offset), ' ', spaces);
|
|
|
1f016a |
(*offset) += spaces;
|
|
|
1f016a |
@@ -305,7 +305,7 @@ static void __xml_schema_add(
|
|
|
1f016a |
int last = xml_schema_max;
|
|
|
1f016a |
|
|
|
1f016a |
xml_schema_max++;
|
|
|
1f016a |
- known_schemas = realloc(known_schemas, xml_schema_max*sizeof(struct schema_s));
|
|
|
1f016a |
+ known_schemas = realloc_safe(known_schemas, xml_schema_max*sizeof(struct schema_s));
|
|
|
1f016a |
CRM_ASSERT(known_schemas != NULL);
|
|
|
1f016a |
memset(known_schemas+last, 0, sizeof(struct schema_s));
|
|
|
1f016a |
known_schemas[last].type = type;
|
|
|
1f016a |
@@ -2759,6 +2759,7 @@ create_xml_node(xmlNode * parent, const char *name)
|
|
|
1f016a |
xmlNode *node = NULL;
|
|
|
1f016a |
|
|
|
1f016a |
if (name == NULL || name[0] == 0) {
|
|
|
1f016a |
+ CRM_CHECK(name != NULL || name[0] == 0, return NULL);
|
|
|
1f016a |
return NULL;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
@@ -2905,7 +2906,7 @@ crm_xml_err(void *ctx, const char *msg, ...)
|
|
|
1f016a |
buf = NULL;
|
|
|
1f016a |
|
|
|
1f016a |
} else {
|
|
|
1f016a |
- buffer = realloc(buffer, 1 + buffer_len + len);
|
|
|
1f016a |
+ buffer = realloc_safe(buffer, 1 + buffer_len + len);
|
|
|
1f016a |
memcpy(buffer + buffer_len, buf, len);
|
|
|
1f016a |
buffer_len += len;
|
|
|
1f016a |
buffer[buffer_len] = 0;
|
|
|
1f016a |
@@ -2997,7 +2998,7 @@ stdin2xml(void)
|
|
|
1f016a |
break;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
- xml_buffer = realloc(xml_buffer, next);
|
|
|
1f016a |
+ xml_buffer = realloc_safe(xml_buffer, next);
|
|
|
1f016a |
read_chars = fread(xml_buffer + data_length, 1, XML_BUFFER_SIZE, stdin);
|
|
|
1f016a |
data_length += read_chars;
|
|
|
1f016a |
} while (read_chars > 0);
|
|
|
1f016a |
@@ -3043,7 +3044,7 @@ decompress_file(const char *filename)
|
|
|
1f016a |
|
|
|
1f016a |
rc = BZ_OK;
|
|
|
1f016a |
while (rc == BZ_OK) {
|
|
|
1f016a |
- buffer = realloc(buffer, XML_BUFFER_SIZE + length + 1);
|
|
|
1f016a |
+ buffer = realloc_safe(buffer, XML_BUFFER_SIZE + length + 1);
|
|
|
1f016a |
read_len = BZ2_bzRead(&rc, bz_file, buffer + length, XML_BUFFER_SIZE);
|
|
|
1f016a |
|
|
|
1f016a |
crm_trace("Read %ld bytes from file: %d", (long)read_len, rc);
|
|
|
1f016a |
@@ -3301,7 +3302,7 @@ crm_xml_escape_shuffle(char *text, int start, int *length, const char *replace)
|
|
|
1f016a |
int offset = strlen(replace) - 1; /* We have space for 1 char already */
|
|
|
1f016a |
|
|
|
1f016a |
*length += offset;
|
|
|
1f016a |
- text = realloc(text, *length);
|
|
|
1f016a |
+ text = realloc_safe(text, *length);
|
|
|
1f016a |
|
|
|
1f016a |
for (lpc = (*length) - 1; lpc > (start + offset); lpc--) {
|
|
|
1f016a |
text[lpc] = text[lpc - offset];
|
|
|
1f016a |
@@ -5369,7 +5370,7 @@ crm_xml_init(void)
|
|
|
1f016a |
if(init) {
|
|
|
1f016a |
init = FALSE;
|
|
|
1f016a |
/* The default allocator XML_BUFFER_ALLOC_EXACT does far too many
|
|
|
1f016a |
- * realloc()s and it can take upwards of 18 seconds (yes, seconds)
|
|
|
1f016a |
+ * realloc_safe()s and it can take upwards of 18 seconds (yes, seconds)
|
|
|
1f016a |
* to dump a 28kb tree which XML_BUFFER_ALLOC_DOUBLEIT can do in
|
|
|
1f016a |
* less than 1 second.
|
|
|
1f016a |
*/
|
|
|
1f016a |
@@ -5987,7 +5988,7 @@ get_xpath_object_relative(const char *xpath, xmlNode * xml_obj, int error_level)
|
|
|
1f016a |
len += strlen(xpath);
|
|
|
1f016a |
|
|
|
1f016a |
xpath_full = strdup(xpath_prefix);
|
|
|
1f016a |
- xpath_full = realloc(xpath_full, len + 1);
|
|
|
1f016a |
+ xpath_full = realloc_safe(xpath_full, len + 1);
|
|
|
1f016a |
strncat(xpath_full, xpath, len);
|
|
|
1f016a |
|
|
|
1f016a |
result = get_xpath_object(xpath_full, xml_obj, error_level);
|
|
|
1f016a |
diff --git a/lib/fencing/st_client.c b/lib/fencing/st_client.c
|
|
|
1f016a |
index 06b9492..e51d673 100644
|
|
|
1f016a |
--- a/lib/fencing/st_client.c
|
|
|
1f016a |
+++ b/lib/fencing/st_client.c
|
|
|
1f016a |
@@ -308,7 +308,7 @@ append_arg(gpointer key, gpointer value, gpointer user_data)
|
|
|
1f016a |
last = strlen(*args);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
- *args = realloc(*args, last + len);
|
|
|
1f016a |
+ *args = realloc_safe(*args, last + len);
|
|
|
1f016a |
crm_trace("Appending: %s=%s", (char *)key, (char *)value);
|
|
|
1f016a |
sprintf((*args) + last, "%s=%s\n", (char *)key, (char *)value);
|
|
|
1f016a |
}
|
|
|
1f016a |
@@ -627,7 +627,7 @@ read_output(int fd)
|
|
|
1f016a |
* 'more' is always less than our buffer size
|
|
|
1f016a |
*/
|
|
|
1f016a |
crm_trace("Got %d more bytes: %.200s...", more, buffer);
|
|
|
1f016a |
- output = realloc(output, len + more + 1);
|
|
|
1f016a |
+ output = realloc_safe(output, len + more + 1);
|
|
|
1f016a |
snprintf(output + len, more + 1, "%s", buffer);
|
|
|
1f016a |
len += more;
|
|
|
1f016a |
}
|
|
|
1f016a |
diff --git a/lib/services/services_linux.c b/lib/services/services_linux.c
|
|
|
1f016a |
index 8d6f450..de29706 100644
|
|
|
1f016a |
--- a/lib/services/services_linux.c
|
|
|
1f016a |
+++ b/lib/services/services_linux.c
|
|
|
1f016a |
@@ -94,7 +94,7 @@ svc_read_output(int fd, svc_action_t * op, bool is_stderr)
|
|
|
1f016a |
if (rc > 0) {
|
|
|
1f016a |
crm_trace("Got %d characters starting with %.20s", rc, buf);
|
|
|
1f016a |
buf[rc] = 0;
|
|
|
1f016a |
- data = realloc(data, len + rc + 1);
|
|
|
1f016a |
+ data = realloc_safe(data, len + rc + 1);
|
|
|
1f016a |
len += sprintf(data + len, "%s", buf);
|
|
|
1f016a |
|
|
|
1f016a |
} else if (errno != EINTR) {
|
|
|
1f016a |
diff --git a/lib/services/systemd.c b/lib/services/systemd.c
|
|
|
1f016a |
index a8bf1b4..c0a1721 100644
|
|
|
1f016a |
--- a/lib/services/systemd.c
|
|
|
1f016a |
+++ b/lib/services/systemd.c
|
|
|
1f016a |
@@ -462,10 +462,11 @@ systemd_async_dispatch(DBusPendingCall *pending, void *user_data)
|
|
|
1f016a |
if(op) {
|
|
|
1f016a |
crm_trace("Got result: %p for %p for %s, %s", reply, pending, op->rsc, op->action);
|
|
|
1f016a |
op->opaque->pending = NULL;
|
|
|
1f016a |
+ systemd_exec_result(reply, op);
|
|
|
1f016a |
+
|
|
|
1f016a |
} else {
|
|
|
1f016a |
crm_trace("Got result: %p for %p", reply, pending);
|
|
|
1f016a |
}
|
|
|
1f016a |
- systemd_exec_result(reply, op);
|
|
|
1f016a |
|
|
|
1f016a |
if(pending) {
|
|
|
1f016a |
dbus_pending_call_unref(pending);
|
|
|
1f016a |
@@ -491,6 +492,8 @@ systemd_unit_check(const char *name, const char *state, void *userdata)
|
|
|
1f016a |
op->rc = PCMK_OCF_OK;
|
|
|
1f016a |
} else if (g_strcmp0(state, "activating") == 0) {
|
|
|
1f016a |
op->rc = PCMK_OCF_PENDING;
|
|
|
1f016a |
+ } else if (g_strcmp0(state, "deactivating") == 0) {
|
|
|
1f016a |
+ op->rc = PCMK_OCF_PENDING;
|
|
|
1f016a |
} else {
|
|
|
1f016a |
op->rc = PCMK_OCF_NOT_RUNNING;
|
|
|
1f016a |
}
|
|
|
1f016a |
diff --git a/lrmd/lrmd.c b/lrmd/lrmd.c
|
|
|
1f016a |
index d3ede18..0f5f529 100644
|
|
|
1f016a |
--- a/lrmd/lrmd.c
|
|
|
1f016a |
+++ b/lrmd/lrmd.c
|
|
|
1f016a |
@@ -790,10 +790,30 @@ action_complete(svc_action_t * action)
|
|
|
1f016a |
cmd->real_action = cmd->action;
|
|
|
1f016a |
cmd->action = strdup("monitor");
|
|
|
1f016a |
|
|
|
1f016a |
+ } else if(cmd->exec_rc == PCMK_OCF_OK && safe_str_eq(cmd->action, "stop")) {
|
|
|
1f016a |
+ goagain = true;
|
|
|
1f016a |
+ cmd->real_action = cmd->action;
|
|
|
1f016a |
+ cmd->action = strdup("monitor");
|
|
|
1f016a |
+
|
|
|
1f016a |
} else if(cmd->real_action) {
|
|
|
1f016a |
/* Ok, so this is the follow up monitor action to check if start actually completed */
|
|
|
1f016a |
if(cmd->lrmd_op_status == PCMK_LRM_OP_DONE && cmd->exec_rc == PCMK_OCF_PENDING) {
|
|
|
1f016a |
goagain = true;
|
|
|
1f016a |
+
|
|
|
1f016a |
+ } else {
|
|
|
1f016a |
+ int time_sum = 0;
|
|
|
1f016a |
+ int timeout_left = 0;
|
|
|
1f016a |
+ struct timeb now = { 0, };
|
|
|
1f016a |
+
|
|
|
1f016a |
+ ftime(&now;;
|
|
|
1f016a |
+ time_sum = time_diff_ms(&now, &cmd->t_first_run);
|
|
|
1f016a |
+ timeout_left = cmd->timeout_orig - time_sum;
|
|
|
1f016a |
+ crm_debug("%s %s is now complete (elapsed=%dms, remaining=%dms): %s (%d)",
|
|
|
1f016a |
+ cmd->rsc_id, cmd->real_action, time_sum, timeout_left, services_ocf_exitcode_str(cmd->exec_rc), cmd->exec_rc);
|
|
|
1f016a |
+
|
|
|
1f016a |
+ if(cmd->lrmd_op_status == PCMK_LRM_OP_DONE && cmd->exec_rc == PCMK_OCF_NOT_RUNNING && safe_str_eq(cmd->real_action, "stop")) {
|
|
|
1f016a |
+ cmd->exec_rc = PCMK_OCF_OK;
|
|
|
1f016a |
+ }
|
|
|
1f016a |
}
|
|
|
1f016a |
}
|
|
|
1f016a |
}
|
|
|
1f016a |
@@ -827,13 +847,22 @@ action_complete(svc_action_t * action)
|
|
|
1f016a |
delay = timeout_left/2;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
+ delay = QB_MIN(2000, delay);
|
|
|
1f016a |
if (delay < timeout_left) {
|
|
|
1f016a |
cmd->start_delay = delay;
|
|
|
1f016a |
cmd->timeout = timeout_left;
|
|
|
1f016a |
|
|
|
1f016a |
- if(cmd->exec_rc != PCMK_OCF_OK) {
|
|
|
1f016a |
- crm_info("%s %s failed (rc=%d): re-scheduling (elapsed=%dms, remaining=%dms, start_delay=%dms)",
|
|
|
1f016a |
- cmd->rsc_id, cmd->action, cmd->exec_rc, time_sum, timeout_left, delay);
|
|
|
1f016a |
+ if(cmd->exec_rc == PCMK_OCF_OK) {
|
|
|
1f016a |
+ crm_debug("%s %s may still be in progress: re-scheduling (elapsed=%dms, remaining=%dms, start_delay=%dms)",
|
|
|
1f016a |
+ cmd->rsc_id, cmd->real_action, time_sum, timeout_left, delay);
|
|
|
1f016a |
+
|
|
|
1f016a |
+ } else if(cmd->exec_rc == PCMK_OCF_PENDING) {
|
|
|
1f016a |
+ crm_info("%s %s is still in progress: re-scheduling (elapsed=%dms, remaining=%dms, start_delay=%dms)",
|
|
|
1f016a |
+ cmd->rsc_id, cmd->action, time_sum, timeout_left, delay);
|
|
|
1f016a |
+
|
|
|
1f016a |
+ } else {
|
|
|
1f016a |
+ crm_notice("%s %s failed '%s' (%d): re-scheduling (elapsed=%dms, remaining=%dms, start_delay=%dms)",
|
|
|
1f016a |
+ cmd->rsc_id, cmd->action, services_ocf_exitcode_str(cmd->exec_rc), cmd->exec_rc, time_sum, timeout_left, delay);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
cmd_reset(cmd);
|
|
|
1f016a |
diff --git a/pengine/allocate.c b/pengine/allocate.c
|
|
|
1f016a |
index 45e2212..748ca54 100644
|
|
|
1f016a |
--- a/pengine/allocate.c
|
|
|
1f016a |
+++ b/pengine/allocate.c
|
|
|
1f016a |
@@ -1913,7 +1913,7 @@ expand_list(GListPtr list, char **rsc_list, char **node_list)
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
crm_trace("Adding %s (%dc) at offset %d", rsc_id, len - 2, existing_len);
|
|
|
1f016a |
- *rsc_list = realloc(*rsc_list, len + existing_len);
|
|
|
1f016a |
+ *rsc_list = realloc_safe(*rsc_list, len + existing_len);
|
|
|
1f016a |
sprintf(*rsc_list + existing_len, "%s ", rsc_id);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
@@ -1930,7 +1930,7 @@ expand_list(GListPtr list, char **rsc_list, char **node_list)
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
crm_trace("Adding %s (%dc) at offset %d", uname, len - 2, existing_len);
|
|
|
1f016a |
- *node_list = realloc(*node_list, len + existing_len);
|
|
|
1f016a |
+ *node_list = realloc_safe(*node_list, len + existing_len);
|
|
|
1f016a |
sprintf(*node_list + existing_len, "%s ", uname);
|
|
|
1f016a |
}
|
|
|
1f016a |
}
|
|
|
1f016a |
diff --git a/replace/scandir.c b/replace/scandir.c
|
|
|
1f016a |
index 7a8efea..0011630 100644
|
|
|
1f016a |
--- a/replace/scandir.c
|
|
|
1f016a |
+++ b/replace/scandir.c
|
|
|
1f016a |
@@ -202,7 +202,7 @@ scandir(const char *directory_name,
|
|
|
1f016a |
if (counter + 1 == allocated) {
|
|
|
1f016a |
allocated <<= 1;
|
|
|
1f016a |
array = (struct dirent **)
|
|
|
1f016a |
- realloc((char *)array, allocated * sizeof(struct dirent *));
|
|
|
1f016a |
+ realloc_safe((char *)array, allocated * sizeof(struct dirent *));
|
|
|
1f016a |
if (array == NULL) {
|
|
|
1f016a |
closedir(directory);
|
|
|
1f016a |
free(array);
|
|
|
1f016a |
diff --git a/tools/crm_resource.c b/tools/crm_resource.c
|
|
|
1f016a |
index 6e510e1..236d43c 100644
|
|
|
1f016a |
--- a/tools/crm_resource.c
|
|
|
1f016a |
+++ b/tools/crm_resource.c
|
|
|
1f016a |
@@ -1399,16 +1399,20 @@ static void display_list(GList *items, const char *tag)
|
|
|
1f016a |
static int
|
|
|
1f016a |
update_dataset(cib_t *cib, pe_working_set_t * data_set, bool simulate)
|
|
|
1f016a |
{
|
|
|
1f016a |
+ char *pid = NULL;
|
|
|
1f016a |
+ char *shadow_file = NULL;
|
|
|
1f016a |
+ cib_t *shadow_cib = NULL;
|
|
|
1f016a |
xmlNode *cib_xml_copy = NULL;
|
|
|
1f016a |
int rc = cib->cmds->query(cib, NULL, &cib_xml_copy, cib_scope_local | cib_sync_call);
|
|
|
1f016a |
|
|
|
1f016a |
if(rc != pcmk_ok) {
|
|
|
1f016a |
fprintf(stdout, "Could not obtain the current CIB: %s (%d)\n", pcmk_strerror(rc), rc);
|
|
|
1f016a |
- return crm_exit(rc);
|
|
|
1f016a |
+ goto cleanup;
|
|
|
1f016a |
|
|
|
1f016a |
} else if (cli_config_update(&cib_xml_copy, NULL, FALSE) == FALSE) {
|
|
|
1f016a |
fprintf(stderr, "Could not upgrade the current CIB\n");
|
|
|
1f016a |
- return -ENOKEY;
|
|
|
1f016a |
+ rc = -ENOKEY;
|
|
|
1f016a |
+ goto cleanup;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
set_working_set_defaults(data_set);
|
|
|
1f016a |
@@ -1416,70 +1420,103 @@ update_dataset(cib_t *cib, pe_working_set_t * data_set, bool simulate)
|
|
|
1f016a |
data_set->now = crm_time_new(NULL);
|
|
|
1f016a |
|
|
|
1f016a |
if(simulate) {
|
|
|
1f016a |
- char *pid = crm_itoa(getpid());
|
|
|
1f016a |
- cib_t *shadow_cib = cib_shadow_new(pid);
|
|
|
1f016a |
- char *shadow_file = get_shadow_file(pid);
|
|
|
1f016a |
+ pid = crm_itoa(getpid());
|
|
|
1f016a |
+ shadow_cib = cib_shadow_new(pid);
|
|
|
1f016a |
+ shadow_file = get_shadow_file(pid);
|
|
|
1f016a |
|
|
|
1f016a |
if (shadow_cib == NULL) {
|
|
|
1f016a |
fprintf(stderr, "Could not create shadow cib: '%s'\n", pid);
|
|
|
1f016a |
- crm_exit(-ENXIO);
|
|
|
1f016a |
+ rc = -ENXIO;
|
|
|
1f016a |
+ goto cleanup;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
+ free(pid);
|
|
|
1f016a |
rc = write_xml_file(cib_xml_copy, shadow_file, FALSE);
|
|
|
1f016a |
|
|
|
1f016a |
if (rc < 0) {
|
|
|
1f016a |
fprintf(stderr, "Could not populate shadow cib: %s (%d)\n", pcmk_strerror(rc), rc);
|
|
|
1f016a |
- free_xml(cib_xml_copy);
|
|
|
1f016a |
- return rc;
|
|
|
1f016a |
+ goto cleanup;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
rc = shadow_cib->cmds->signon(shadow_cib, crm_system_name, cib_command);
|
|
|
1f016a |
if(rc != pcmk_ok) {
|
|
|
1f016a |
fprintf(stderr, "Could not connect to shadow cib: %s (%d)\n", pcmk_strerror(rc), rc);
|
|
|
1f016a |
- free_xml(cib_xml_copy);
|
|
|
1f016a |
- return rc;
|
|
|
1f016a |
+ goto cleanup;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
do_calculations(data_set, cib_xml_copy, NULL);
|
|
|
1f016a |
run_simulation(data_set, shadow_cib, NULL, TRUE);
|
|
|
1f016a |
rc = update_dataset(shadow_cib, data_set, FALSE);
|
|
|
1f016a |
|
|
|
1f016a |
- cib_delete(shadow_cib);
|
|
|
1f016a |
- /* unlink(shadow_file); */
|
|
|
1f016a |
- free(shadow_file);
|
|
|
1f016a |
-
|
|
|
1f016a |
} else {
|
|
|
1f016a |
cluster_status(data_set);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
+ cleanup:
|
|
|
1f016a |
+ cib_delete(shadow_cib);
|
|
|
1f016a |
+ free_xml(cib_xml_copy);
|
|
|
1f016a |
+ free(pid);
|
|
|
1f016a |
+
|
|
|
1f016a |
+ if(shadow_file) {
|
|
|
1f016a |
+ unlink(shadow_file);
|
|
|
1f016a |
+ free(shadow_file);
|
|
|
1f016a |
+ }
|
|
|
1f016a |
+
|
|
|
1f016a |
return rc;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
static int
|
|
|
1f016a |
-max_delay_in(pe_working_set_t * data_set, GList *resources)
|
|
|
1f016a |
+max_delay_for_resource(pe_working_set_t * data_set, resource_t *rsc)
|
|
|
1f016a |
{
|
|
|
1f016a |
+ int delay = 0;
|
|
|
1f016a |
int max_delay = 0;
|
|
|
1f016a |
- GList *item = NULL;
|
|
|
1f016a |
|
|
|
1f016a |
- for (item = resources; item != NULL; item = item->next) {
|
|
|
1f016a |
- resource_t *rsc = pe_find_resource(data_set->resources, (const char *)item->data);
|
|
|
1f016a |
+ if(rsc && rsc->children) {
|
|
|
1f016a |
+ GList *iter = NULL;
|
|
|
1f016a |
|
|
|
1f016a |
- if(rsc) {
|
|
|
1f016a |
- char *key = g_strdup_printf("%s_%s_0", rsc->id, RSC_STOP);
|
|
|
1f016a |
- action_t *stop = custom_action(rsc, key, RSC_STOP, NULL, TRUE, FALSE, data_set);
|
|
|
1f016a |
- const char *value = g_hash_table_lookup(stop->meta, XML_ATTR_TIMEOUT);
|
|
|
1f016a |
- int delay = crm_int_helper(value, NULL);
|
|
|
1f016a |
+ for(iter = rsc->children; iter; iter = iter->next) {
|
|
|
1f016a |
+ resource_t *child = (resource_t *)iter->data;
|
|
|
1f016a |
|
|
|
1f016a |
+ delay = max_delay_for_resource(data_set, child);
|
|
|
1f016a |
if(delay > max_delay) {
|
|
|
1f016a |
- crm_trace("Calculated new delay of %s ms due to %s", value, rsc->id);
|
|
|
1f016a |
+ double seconds = delay / 1000;
|
|
|
1f016a |
+ crm_trace("Calculated new delay of %.1fs due to %s", seconds, child->id);
|
|
|
1f016a |
max_delay = delay;
|
|
|
1f016a |
}
|
|
|
1f016a |
-
|
|
|
1f016a |
- pe_free_action(stop);
|
|
|
1f016a |
}
|
|
|
1f016a |
+
|
|
|
1f016a |
+ } else if(rsc) {
|
|
|
1f016a |
+ char *key = g_strdup_printf("%s_%s_0", rsc->id, RSC_STOP);
|
|
|
1f016a |
+ action_t *stop = custom_action(rsc, key, RSC_STOP, NULL, TRUE, FALSE, data_set);
|
|
|
1f016a |
+ const char *value = g_hash_table_lookup(stop->meta, XML_ATTR_TIMEOUT);
|
|
|
1f016a |
+
|
|
|
1f016a |
+ max_delay = crm_int_helper(value, NULL);
|
|
|
1f016a |
+ pe_free_action(stop);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
|
|
|
1f016a |
+ return max_delay;
|
|
|
1f016a |
+}
|
|
|
1f016a |
+
|
|
|
1f016a |
+static int
|
|
|
1f016a |
+max_delay_in(pe_working_set_t * data_set, GList *resources)
|
|
|
1f016a |
+{
|
|
|
1f016a |
+ int max_delay = 0;
|
|
|
1f016a |
+ GList *item = NULL;
|
|
|
1f016a |
+
|
|
|
1f016a |
+ for (item = resources; item != NULL; item = item->next) {
|
|
|
1f016a |
+ int delay = 0;
|
|
|
1f016a |
+ resource_t *rsc = pe_find_resource(data_set->resources, (const char *)item->data);
|
|
|
1f016a |
+
|
|
|
1f016a |
+ delay = max_delay_for_resource(data_set, rsc);
|
|
|
1f016a |
+
|
|
|
1f016a |
+ if(delay > max_delay) {
|
|
|
1f016a |
+ double seconds = delay / 1000;
|
|
|
1f016a |
+ crm_trace("Calculated new delay of %.1fs due to %s", seconds, rsc->id);
|
|
|
1f016a |
+ max_delay = delay;
|
|
|
1f016a |
+ }
|
|
|
1f016a |
+ }
|
|
|
1f016a |
+
|
|
|
1f016a |
return 5 + (max_delay / 1000);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
@@ -1507,7 +1544,7 @@ resource_restart(resource_t * rsc, const char *host, int timeout_ms, cib_t * cib
|
|
|
1f016a |
return -ENXIO;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
-
|
|
|
1f016a |
+ attr_set_type = XML_TAG_META_SETS;
|
|
|
1f016a |
rsc_id = strdup(rsc->id);
|
|
|
1f016a |
if(rsc->variant > pe_group) {
|
|
|
1f016a |
is_clone = TRUE;
|
|
|
1f016a |
@@ -1536,6 +1573,7 @@ resource_restart(resource_t * rsc, const char *host, int timeout_ms, cib_t * cib
|
|
|
1f016a |
rc = update_dataset(cib, &data_set, FALSE);
|
|
|
1f016a |
if(rc != pcmk_ok) {
|
|
|
1f016a |
fprintf(stdout, "Could not get new resource list: %s (%d)\n", pcmk_strerror(rc), rc);
|
|
|
1f016a |
+ free(rsc_id);
|
|
|
1f016a |
return rc;
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
@@ -1553,6 +1591,7 @@ resource_restart(resource_t * rsc, const char *host, int timeout_ms, cib_t * cib
|
|
|
1f016a |
}
|
|
|
1f016a |
if(rc != pcmk_ok) {
|
|
|
1f016a |
fprintf(stderr, "Could not set target-role for %s: %s (%d)\n", rsc_id, pcmk_strerror(rc), rc);
|
|
|
1f016a |
+ free(rsc_id);
|
|
|
1f016a |
return crm_exit(rc);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
@@ -1615,6 +1654,7 @@ resource_restart(resource_t * rsc, const char *host, int timeout_ms, cib_t * cib
|
|
|
1f016a |
|
|
|
1f016a |
if(rc != pcmk_ok) {
|
|
|
1f016a |
fprintf(stderr, "Could not unset target-role for %s: %s (%d)\n", rsc_id, pcmk_strerror(rc), rc);
|
|
|
1f016a |
+ free(rsc_id);
|
|
|
1f016a |
return crm_exit(rc);
|
|
|
1f016a |
}
|
|
|
1f016a |
|
|
|
1f016a |
@@ -1659,6 +1699,7 @@ resource_restart(resource_t * rsc, const char *host, int timeout_ms, cib_t * cib
|
|
|
1f016a |
|
|
|
1f016a |
} while(g_list_length(list_delta) > 0);
|
|
|
1f016a |
|
|
|
1f016a |
+ free(rsc_id);
|
|
|
1f016a |
return pcmk_ok;
|
|
|
1f016a |
|
|
|
1f016a |
failure:
|
|
|
1f016a |
@@ -1668,6 +1709,7 @@ resource_restart(resource_t * rsc, const char *host, int timeout_ms, cib_t * cib
|
|
|
1f016a |
} else {
|
|
|
1f016a |
delete_resource_attr(rsc_id, NULL, NULL, XML_RSC_ATTR_TARGET_ROLE, cib, &data_set);
|
|
|
1f016a |
}
|
|
|
1f016a |
+ free(rsc_id);
|
|
|
1f016a |
return rc;
|
|
|
1f016a |
}
|
|
|
1f016a |
|