|
@@ -165,7 +165,7 @@ PHP_METHOD(ChannelCredentials, createSsl) {
|
|
|
}
|
|
|
|
|
|
php_grpc_int hashkey_len = root_certs_length + cert_chain_length;
|
|
|
- char hashkey[hashkey_len];
|
|
|
+ char *hashkey = emalloc(hashkey_len);
|
|
|
if (root_certs_length > 0) {
|
|
|
strcpy(hashkey, pem_root_certs);
|
|
|
}
|
|
@@ -181,6 +181,7 @@ PHP_METHOD(ChannelCredentials, createSsl) {
|
|
|
pem_key_cert_pair.private_key == NULL ? NULL : &pem_key_cert_pair, NULL);
|
|
|
zval *creds_object = grpc_php_wrap_channel_credentials(creds, hashstr, false
|
|
|
TSRMLS_CC);
|
|
|
+ efree(hashkey);
|
|
|
RETURN_DESTROY_ZVAL(creds_object);
|
|
|
}
|
|
|
|