Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 82e63fe

Browse files
committed
[CID 16023] XML_NewDocument(): Resource leak.
1 parent 1a70264 commit 82e63fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

revxml/src/revxml.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,15 @@ void XML_NewDocument(char *args[], int nargs, char **retstring,
385385
*pass = False;
386386
*error = False;
387387
char *result = NULL;
388-
CXMLDocument *newdoc = new CXMLDocument;
389-
if (nargs < 2){
390388

389+
if (nargs < 2){
391390

392391
*error = True;
393392
result = istrdup(xmlerrors[XMLERR_BADARGUMENTS]);
394393
}
395394
else{
395+
CXMLDocument *newdoc = new CXMLDocument;
396+
396397
Bool wellformed = util_strnicmp(args[1],"TRUE",4) == 0;
397398

398399
Bool buildtree = True;

0 commit comments

Comments
 (0)