Memory released through xmlFreeDoc should be acquired with xmlMalloc

Change-Id: I70db57257fa8226d9f18b7d970d85cc1769252ad