Merge pull request #14017 from ZhouyihaiDing/php_channl_memory_leak
php: fix memory leak during creating channel
diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c
index dc3acc8..db59869 100644
--- a/src/php/ext/grpc/channel.c
+++ b/src/php/ext/grpc/channel.c
@@ -242,6 +242,7 @@
// parse the rest of the channel args array
if (php_grpc_read_args_array(args_array, &args TSRMLS_CC) == FAILURE) {
+ efree(args.args);
return;
}
@@ -301,6 +302,7 @@
create_and_add_channel_to_persistent_list(
channel, target, args, creds, key, key_len TSRMLS_CC);
} else {
+ efree(args.args);
channel->wrapper = le->channel;
}
}