Skip to content

Commit

Permalink
Fix: memory leak found by valgrind was corrected.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuusuke committed Feb 27, 2014
1 parent 549ea3d commit 137b4aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cib/messages.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ cib_process_ping(const char *op, int options, const char *section, xmlNode * req

crm_info("Reporting our current digest to %s: %s (%d)", host, digest, cs && cs->targets);

free(digest);

return pcmk_ok;
#endif
}
Expand Down
6 changes: 5 additions & 1 deletion lib/common/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,10 @@ xml_create_patchset(int format, xmlNode *source, xmlNode *target, bool *config_c
}

if(patch && with_digest) {
const char *digest = calculate_xml_versioned_digest(target, FALSE, TRUE, version);
char *digest = calculate_xml_versioned_digest(target, FALSE, TRUE, version);

crm_xml_add(patch, XML_ATTR_DIGEST, digest);
free(digest);
}
return patch;
}
Expand Down Expand Up @@ -1355,7 +1356,9 @@ __xml_find_path(xmlNode *top, const char *key)

free(remainder);
free(current);
free(section);
free(tag);
free(id);
return target;
}

Expand Down Expand Up @@ -1559,6 +1562,7 @@ xml_apply_patchset(xmlNode *xml, xmlNode *patchset, bool check_version)
crm_trace("Digest matched: expected %s, calculated %s", digest, new_digest);
}
free(new_digest);
free(version);
}
free_xml(old);
return rc;
Expand Down

0 comments on commit 137b4aa

Please sign in to comment.