@@ -407,8 +407,7 @@ static PHP_METHOD(Memcached, __construct)
407407 zend_fcall_info fci = {0 };
408408 zend_fcall_info_cache fci_cache ;
409409
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 ) {
412411 return ;
413412 }
414413
@@ -1299,14 +1298,8 @@ static void php_memc_setMulti_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool by_ke
12991298retry :
13001299 if (!by_key ) {
13011300 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- }
13051301 } else {
13061302 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- }
13101303 }
13111304
13121305 if (php_memc_handle_error (i_obj , status ) < 0 ) {
@@ -2760,11 +2753,9 @@ static PHP_METHOD(Memcached, getResultMessage)
27602753 case MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE :
27612754 case MEMCACHED_UNKNOWN_READ_FAILURE :
27622755 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 );
27682759 }
27692760 /* Fall through */
27702761 default :
@@ -3128,7 +3119,7 @@ zend_bool s_serialize_value (enum memcached_serializer serializer, zval *value,
31283119#ifdef HAVE_MEMCACHED_MSGPACK
31293120 case SERIALIZER_MSGPACK :
31303121 php_msgpack_serialize (buf , value );
3131- if (!buf -> c ) {
3122+ if (!buf -> s ) {
31323123 php_error_docref (NULL , E_WARNING , "could not serialize value with msgpack" );
31333124 return 0 ;
31343125 }
0 commit comments