mongodb/mongo-c-driver — pull request #76 by noa-- (2013-02-04 04:34:17+00:00)
Title: Calling bson_empty and then bson_destroy attempts to free memory it shouldn't

It should be legal to call bson_destroy after bson_empty, but currently isn't. Since we own the shared static data, just check if that's the one we're about to release before we invoke bson_free.