aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php/ext
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanley.cheung@gmail.com>2018-01-24 10:59:07 -0800
committerGravatar GitHub <noreply@github.com>2018-01-24 10:59:07 -0800
commitc84c8d44c7e835f1906cdb9f3f33248b593305c7 (patch)
tree38095d6ce4e964cb5d525806e859c8175be44a44 /src/php/ext
parentd29d709b35969d9a022905056c90d2d1bcec9b8f (diff)
parent159ceb6fb1486885950589e3730d5521e92baea8 (diff)
Merge pull request #14160 from ZhouyihaiDing/pr_call_peer_leak
php: fix call return peer leak
Diffstat (limited to 'src/php/ext')
-rw-r--r--src/php/ext/grpc/call.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c
index e883537c64..115358d600 100644
--- a/src/php/ext/grpc/call.c
+++ b/src/php/ext/grpc/call.c
@@ -539,7 +539,9 @@ cleanup:
*/
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);
}
/**