Add error checking for server args in PHP

pull/16361/head
ncteisen 6 years ago
parent 8165c4c0aa
commit befcfee767
  1. 5
      src/php/ext/grpc/server.c

@ -75,7 +75,10 @@ PHP_METHOD(Server, __construct) {
if (args_array == NULL) { if (args_array == NULL) {
server->wrapped = grpc_server_create(NULL, NULL); server->wrapped = grpc_server_create(NULL, NULL);
} else { } else {
php_grpc_read_args_array(args_array, &args TSRMLS_CC); if (php_grpc_read_args_array(args_array, &args TSRMLS_CC) == FAILURE) {
efree(args.args);
return;
}
server->wrapped = grpc_server_create(&args, NULL); server->wrapped = grpc_server_create(&args, NULL);
efree(args.args); efree(args.args);
} }

Loading…
Cancel
Save