Navigation Menu

Skip to content

Commit

Permalink
Fix: PE: Memory leak when updating cancel operations
Browse files Browse the repository at this point in the history
  • Loading branch information
beekhof committed Feb 28, 2014
1 parent b593e97 commit 37457be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pengine/allocate.c
Expand Up @@ -172,6 +172,7 @@ CancelXmlOp(resource_t * rsc, xmlNode * xml_op, node_t * active_node,
cancel = custom_action(rsc, strdup(key), RSC_CANCEL, active_node, FALSE, TRUE, data_set);

free(cancel->task);
free(cancel->cancel_task);
cancel->task = strdup(RSC_CANCEL);
cancel->cancel_task = strdup(task);

Expand Down
2 changes: 2 additions & 0 deletions pengine/native.c
Expand Up @@ -730,6 +730,7 @@ RecurringOp(resource_t * rsc, action_t * start, node_t * node,
mon = custom_action(rsc, local_key, RSC_CANCEL, node, FALSE, TRUE, data_set);

free(mon->task);
free(mon->cancel_task);
mon->task = strdup(RSC_CANCEL);
mon->cancel_task = strdup(name);
add_hash_param(mon->meta, XML_LRM_ATTR_INTERVAL, interval);
Expand Down Expand Up @@ -907,6 +908,7 @@ RecurringOp_Stopped(resource_t * rsc, action_t * start, node_t * node,
cancel_op = custom_action(rsc, local_key, RSC_CANCEL, node, FALSE, TRUE, data_set);

free(cancel_op->task);
free(cancel_op->cancel_task);
cancel_op->task = strdup(RSC_CANCEL);
cancel_op->cancel_task = strdup(name);
add_hash_param(cancel_op->meta, XML_LRM_ATTR_INTERVAL, interval);
Expand Down

0 comments on commit 37457be

Please sign in to comment.