@@ -296,9 +296,10 @@ static mongoc_client_encryption_opts_t* phongo_clientencryption_opts_from_zval(z
296
296
return NULL ;
297
297
} /* }}} */
298
298
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 ) /* {{{ */
300
300
{
301
- mongoc_client_encryption_t * ce ;
301
+ php_phongo_clientencryption_t * intern ;
302
+ mongoc_client_encryption_t * client_encryption ;
302
303
mongoc_client_encryption_opts_t * opts ;
303
304
zval * key_vault_client_manager = manager ;
304
305
bson_error_t error = { 0 };
@@ -309,15 +310,18 @@ void phongo_clientencryption_init(php_phongo_clientencryption_t* clientencryptio
309
310
goto cleanup ;
310
311
}
311
312
312
- ce = mongoc_client_encryption_new (opts , & error );
313
- if (!ce ) {
313
+ client_encryption = mongoc_client_encryption_new (opts , & error );
314
+ if (!client_encryption ) {
314
315
phongo_throw_exception_from_bson_error_t (& error );
315
316
316
317
goto cleanup ;
317
318
}
318
319
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 );
321
325
322
326
cleanup :
323
327
if (opts ) {
0 commit comments