X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fhosts.cc;h=89896e85c50a1071315eb9ce39749920eff25bbd;hb=8368c501914b1a6fcd722395d07879bad65c540d;hp=db6398914a699472d6163c3d4327b9f882e93055;hpb=9cd57ce737375540f6c3b5e2e3684160e5c4bfce;p=awesomized%2Flibmemcached diff --git a/libmemcached/hosts.cc b/libmemcached/hosts.cc index db639891..89896e85 100644 --- a/libmemcached/hosts.cc +++ b/libmemcached/hosts.cc @@ -246,7 +246,8 @@ static memcached_return_t update_continuum(memcached_st *ptr) if (sort_host_length >= MEMCACHED_MAX_HOST_SORT_LENGTH || sort_host_length < 0) { - return MEMCACHED_FAILURE; + return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, + memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)")); } #ifdef DEBUG printf("update_continuum: key is %s\n", sort_host); @@ -298,7 +299,8 @@ static memcached_return_t update_continuum(memcached_st *ptr) if (sort_host_length >= MEMCACHED_MAX_HOST_SORT_LENGTH || sort_host_length < 0) { - return MEMCACHED_FAILURE; + return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, + memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)")); } WATCHPOINT_ASSERT(sort_host_length);