nsgmls: Coverity 174584
authorPeter Howkins <flibble@users.sf.net>
Tue, 3 Jul 2018 17:14:53 +0000 (18:14 +0100)
committerPeter Howkins <flibble@users.sf.net>
Tue, 3 Jul 2018 17:14:53 +0000 (18:14 +0100)
cde/programs/nsgmls/parseSd.C

index 4ed5c7a2033db94c19f3bb39d424a19fb99573cd..efd8532e5c32ddc9812b9e68caef43511aa47a1e 100644 (file)
@@ -276,8 +276,10 @@ Boolean Parser::implySgmlDecl()
   else
     spec = &coreSyntax;
   CharSwitcher switcher;
-  if (!setStandardSyntax(*syntaxp, *spec, sd().docCharset(), switcher))
+  if (!setStandardSyntax(*syntaxp, *spec, sd().docCharset(), switcher)) {
+    delete syntaxp;
     return 0;
+  }
   syntaxp->implySgmlChar(sd().docCharset());
   for (int i = 0; i < Syntax::nQuantity; i++)
     syntaxp->setQuantity(i, options().quantity[i]);