Skip to content

Commit 47619db

Browse files
committed
Fix memory leak in _phongo_debug_bson()
The string returned by bson_as_json() must be freed.
1 parent 6f82d0e commit 47619db

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

php_phongo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,7 @@ void _phongo_debug_bson(bson_t *bson)
19821982
str = bson_as_json(bson, &str_len);
19831983

19841984
php_printf("JSON: %s\n", str);
1985+
bson_free(str);
19851986
}
19861987
/* LCOV_EXCL_STOP */
19871988
#endif

0 commit comments

Comments
 (0)