Skip to content

Commit 4924d8b

Browse files
committed
PHPC-1072: mongoc_client_command_with_opts() reply must always be freed
Previously, reply might leak if phongo_execute_command() returned due to an error (result=false).
1 parent 2be8af5 commit 4924d8b

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
@@ -854,6 +854,7 @@ int phongo_execute_command(mongoc_client_t *client, php_phongo_command_type_t ty
854854
}
855855
if (!result) {
856856
phongo_throw_exception_from_bson_error_t(&error TSRMLS_CC);
857+
bson_destroy(&reply);
857858
bson_destroy(&opts);
858859
return false;
859860
}

0 commit comments

Comments
 (0)