From e1b69e44f1fb2085e01865ea3fe73539edbe7757 Mon Sep 17 00:00:00 2001 From: Karl Lehenbauer Date: Thu, 13 Feb 2014 17:36:08 +0000 Subject: [PATCH] Make sure a Tcl error string gets set if mongotcl_cmdNameObjToBson fails. BUGZID: --- generic/bson.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generic/bson.c b/generic/bson.c index 7de0077..2a1720f 100644 --- a/generic/bson.c +++ b/generic/bson.c @@ -237,10 +237,11 @@ mongotcl_cmdNameObjToBson (Tcl_Interp *interp, Tcl_Obj *commandNameObj, bson **b Tcl_CmdInfo cmdInfo; if (!Tcl_GetCommandInfo (interp, Tcl_GetString(commandNameObj), &cmdInfo)) { - return TCL_ERROR; + goto lookup_error; } if (cmdInfo.objClientData == NULL || ((mongotcl_bsonClientData *)cmdInfo.objClientData)->bson_magic != MONGOTCL_BSON_MAGIC) { + lookup_error: Tcl_AppendResult (interp, "Error: '", Tcl_GetString (commandNameObj), "' is not a bson object", NULL); return TCL_ERROR; }