Skip to content

Commit

Permalink
Merge pull request grpc#14160 from ZhouyihaiDing/pr_call_peer_leak
Browse files Browse the repository at this point in the history
php: fix call return peer leak
  • Loading branch information
stanley-cheung committed Jan 24, 2018
2 parents d29d709 + 159ceb6 commit c84c8d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/php/ext/grpc/call.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,9 @@ PHP_METHOD(Call, startBatch) {
*/
PHP_METHOD(Call, getPeer) {
wrapped_grpc_call *call = Z_WRAPPED_GRPC_CALL_P(getThis());
PHP_GRPC_RETURN_STRING(grpc_call_get_peer(call->wrapped), 1);
char *peer = grpc_call_get_peer(call->wrapped);
PHP_GRPC_RETVAL_STRING(peer, 1);
gpr_free(peer);
}

/**
Expand Down

0 comments on commit c84c8d4

Please sign in to comment.