From 7712950fb7f6607e390365dbf866ec569e2d5c75 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 19 Sep 2018 11:28:48 -0600 Subject: [PATCH] docbook/instant: fix a few more issues --- cde/programs/dtdocbook/doc2sdl/docbook.tcl | 10 ++++++---- cde/programs/dtdocbook/instant/main.c | 5 ++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cde/programs/dtdocbook/doc2sdl/docbook.tcl b/cde/programs/dtdocbook/doc2sdl/docbook.tcl index 01578f8f..3cef0f92 100755 --- a/cde/programs/dtdocbook/doc2sdl/docbook.tcl +++ b/cde/programs/dtdocbook/doc2sdl/docbook.tcl @@ -1624,10 +1624,12 @@ proc EndPart {} { # check that all the glossed terms have been defined foreach name [array names currentGlossArray] { - if {[lindex $currentGlossArray($name) 1] != "defined"} { - set glossString [lindex $currentGlossArray($name) 2] - UserError "No glossary definition for \"$glossString\"" no - } + if {[info exists currentGlossArray($name)]} { + if {[lindex $currentGlossArray($name) 1] != "defined"} { + set glossString [lindex $currentGlossArray($name) 2] + UserError "No glossary definition for \"$glossString\"" no + } + } } # delete this glossary array diff --git a/cde/programs/dtdocbook/instant/main.c b/cde/programs/dtdocbook/instant/main.c index 8297cf2a..65a65e99 100644 --- a/cde/programs/dtdocbook/instant/main.c +++ b/cde/programs/dtdocbook/instant/main.c @@ -376,7 +376,7 @@ static int DefaultOutputString(ClientData clientData, pArgv = argv[1]; stringLength = (2 * strlen(pArgv)) + 3; - string = malloc(stringLength); + string = Tcl_Alloc(stringLength); memset(string, 0, stringLength); pString = string; @@ -403,8 +403,7 @@ static int DefaultOutputString(ClientData clientData, /* put the string to the output */ retCode = Tcl_VarEval(interpreter, "puts -nonewline ", string, 0); - - free(string); + Tcl_Free(string); /* and ripple up any error code we got from the "puts" */ return retCode; -- 2.25.1