@@ -296,9 +296,10 @@ static mongoc_client_encryption_opts_t* phongo_clientencryption_opts_from_zval(z
296296 return NULL ;
297297} /* }}} */
298298
299- void phongo_clientencryption_init (php_phongo_clientencryption_t * clientencryption , zval * manager , zval * options ) /* {{{ */
299+ void phongo_clientencryption_init (zval * return_value , zval * manager , zval * options ) /* {{{ */
300300{
301- mongoc_client_encryption_t * ce ;
301+ php_phongo_clientencryption_t * intern ;
302+ mongoc_client_encryption_t * client_encryption ;
302303 mongoc_client_encryption_opts_t * opts ;
303304 zval * key_vault_client_manager = manager ;
304305 bson_error_t error = { 0 };
@@ -309,15 +310,18 @@ void phongo_clientencryption_init(php_phongo_clientencryption_t* clientencryptio
309310 goto cleanup ;
310311 }
311312
312- ce = mongoc_client_encryption_new (opts , & error );
313- if (!ce ) {
313+ client_encryption = mongoc_client_encryption_new (opts , & error );
314+ if (!client_encryption ) {
314315 phongo_throw_exception_from_bson_error_t (& error );
315316
316317 goto cleanup ;
317318 }
318319
319- clientencryption -> client_encryption = ce ;
320- ZVAL_ZVAL (& clientencryption -> key_vault_client_manager , key_vault_client_manager , 1 , 0 );
320+ object_init_ex (return_value , php_phongo_clientencryption_ce );
321+
322+ intern = Z_CLIENTENCRYPTION_OBJ_P (return_value );
323+ intern -> client_encryption = client_encryption ;
324+ ZVAL_ZVAL (& intern -> key_vault_client_manager , key_vault_client_manager , 1 , 0 );
321325
322326cleanup :
323327 if (opts ) {
0 commit comments