Possible leak in xml-tree.c [IM 6.4.3-5]
Posted: 2008-08-29T07:11:53-07:00
On line 557 of xml-tree.c, root->processing_instructions is freed if root->processing_instructions[0] is not NULL. There is however a possibility that the wrapping IF statement is never entered due to the loop above the IF statement destroying root->processing_instructions[0].
Code: Select all
for (i=0; root->processing_instructions[i] != (char **) NULL; i++)
{
for (j=0; root->processing_instructions[i][j] != (char *) NULL; j++)
root->processing_instructions[i][j]=DestroyString(
root->processing_instructions[i][j]);
root->processing_instructions[i][j+1]=DestroyString(
root->processing_instructions[i][j+1]);
[b] root->processing_instructions[i]=(char **) RelinquishMagickMemory(
root->processing_instructions[i]);[/b]
}
[b] if (root->processing_instructions[0] != (char **) NULL)[/b]
root->processing_instructions=(char ***) RelinquishMagickMemory(
root->processing_instructions);