Skip to content

Commit

Permalink
Fix: crmd: Resolve memory leak in remote_proxy_cb()
Browse files Browse the repository at this point in the history
Resolve memory leak introduced by 446a100
  • Loading branch information
gao-yan committed Aug 13, 2015
1 parent 4ad07f5 commit e5ad5ff
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crmd/lrm_state.c
Expand Up @@ -535,15 +535,12 @@ remote_proxy_cb(lrmd_t *lrmd, void *userdata, xmlNode *msg)

} else if(is_set(flags, crm_ipc_proxied)) {
const char *type = crm_element_value(request, F_TYPE);
const char *host = NULL;
int rc;

if (safe_str_eq(type, T_ATTRD)) {
host = crm_element_value_copy(request, F_ATTRD_HOST);
if (host == NULL) {
crm_xml_add(request, F_ATTRD_HOST, proxy->node_name);
crm_xml_add_int(request, F_ATTRD_HOST_ID, get_local_nodeid(0));
}
if (safe_str_eq(type, T_ATTRD)
&& crm_element_value(request, F_ATTRD_HOST) == NULL) {
crm_xml_add(request, F_ATTRD_HOST, proxy->node_name);
crm_xml_add_int(request, F_ATTRD_HOST_ID, get_local_nodeid(0));
}

rc = crm_ipc_send(proxy->ipc, request, flags, 5000, NULL);
Expand Down

0 comments on commit e5ad5ff

Please sign in to comment.