From 68931ccbad472d24af2ae932ccd4d60c13b296f6 Mon Sep 17 00:00:00 2001 From: Karl Lehenbauer Date: Tue, 25 Feb 2014 00:54:49 +0000 Subject: [PATCH] Fix major memory leak when reusing bson objects. We now call bson_destroy on the underlying structure before calling bson_init on it. BUGZID: --- generic/bson.c | 1 + 1 file changed, 1 insertion(+) diff --git a/generic/bson.c b/generic/bson.c index 9804921..c3ed306 100644 --- a/generic/bson.c +++ b/generic/bson.c @@ -877,6 +877,7 @@ mongotcl_bsonObjectObjCmd(ClientData cData, Tcl_Interp *interp, int objc, Tcl_Ob switch ((enum options) optIndex) { case OPT_INIT: { + bson_destroy (bd->bson); bson_init (bd->bson); break; }