Plug memory leak in xmlwf's end of doctype declaration handler
@@ -369,8 +369,12 @@ endDoctypeDecl(void *userData)
/* How many notations do we have? */
for (p = data->notationListHead; p != NULL; p = p->next)
notationCount++;
- if (notationCount == 0)
- return; /* Nothing to report */
+ if (notationCount == 0) {
+ /* Nothing to report */
+ free((void *)data->currentDoctypeName);
+ data->currentDoctypeName = NULL;
+ return;
+ }
notations = malloc(notationCount * sizeof(NotationList *));
if (notations == NULL) {
