Skip to content

Commit

Permalink
Fix major memory leak when reusing bson objects. We now call bson_des…
Browse files Browse the repository at this point in the history
…troy on the underlying structure before calling bson_init on it.

BUGZID:
  • Loading branch information
lehenbauer committed Feb 25, 2014
1 parent 78846ce commit 68931cc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions generic/bson.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 68931cc

Please sign in to comment.