@@ -407,8 +407,7 @@ static PHP_METHOD(Memcached, __construct)
407
407
zend_fcall_info fci = {0 };
408
408
zend_fcall_info_cache fci_cache ;
409
409
410
- if (zend_parse_parameters (ZEND_NUM_ARGS (), "|S!f!S" , & persistent_id , & fci , & fci_cache , & conn_str ) == FAILURE ) {
411
- ZEND_CTOR_MAKE_NULL ();
410
+ if (zend_parse_parameters_throw (ZEND_NUM_ARGS (), "|S!f!S" , & persistent_id , & fci , & fci_cache , & conn_str ) == FAILURE ) {
412
411
return ;
413
412
}
414
413
@@ -1299,14 +1298,8 @@ static void php_memc_setMulti_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_ke
1299
1298
retry :
1300
1299
if (!by_key ) {
1301
1300
status = memcached_set (m_obj -> memc , str_key -> val , str_key -> len , payload , payload_len , expiration , flags );
1302
- if (!skey ) {
1303
- zend_string_release (str_key );
1304
- }
1305
1301
} else {
1306
1302
status = memcached_set_by_key (m_obj -> memc , server_key -> val , server_key -> len , str_key -> val , str_key -> len , payload , payload_len , expiration , flags );
1307
- if (!skey ) {
1308
- zend_string_release (str_key );
1309
- }
1310
1303
}
1311
1304
1312
1305
if (php_memc_handle_error (i_obj , status ) < 0 ) {
@@ -2760,11 +2753,9 @@ static PHP_METHOD(Memcached, getResultMessage)
2760
2753
case MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE :
2761
2754
case MEMCACHED_UNKNOWN_READ_FAILURE :
2762
2755
if (i_obj -> memc_errno ) {
2763
- char * str ;
2764
- int str_len ;
2765
- str_len = spprintf (& str , 0 , "%s: %s" , memcached_strerror (m_obj -> memc , (memcached_return )i_obj -> rescode ),
2766
- strerror (i_obj -> memc_errno ));
2767
- RETURN_STRINGL (str , str_len );
2756
+ zend_string * str = strpprintf (0 , "%s: %s" ,
2757
+ memcached_strerror (m_obj -> memc , (memcached_return )i_obj -> rescode ), strerror (i_obj -> memc_errno ));
2758
+ RETURN_STR (str );
2768
2759
}
2769
2760
/* Fall through */
2770
2761
default :
@@ -3128,7 +3119,7 @@ zend_bool s_serialize_value (enum memcached_serializer serializer, zval *value,
3128
3119
#ifdef HAVE_MEMCACHED_MSGPACK
3129
3120
case SERIALIZER_MSGPACK :
3130
3121
php_msgpack_serialize (buf , value );
3131
- if (!buf -> c ) {
3122
+ if (!buf -> s ) {
3132
3123
php_error_docref (NULL , E_WARNING , "could not serialize value with msgpack" );
3133
3124
return 0 ;
3134
3125
}
0 commit comments