~brianaker/libmemcached/1164440

« back to all changes in this revision

Viewing changes to libmemcached/hosts.cc

  • Committer: Brian Aker
  • Date: 2011-10-05 21:43:41 UTC
  • mfrom: (929.1.285 libmemcached-build)
  • mto: This revision was merged to the branch mainline in revision 967.
  • Revision ID: brian@tangent.org-20111005214341-le14e1xyyyph9ymq
MergeĀ inĀ touch/etc

Show diffs side-by-side

added added

removed removed

Lines of Context:
362
362
  memcached_server_st *new_host_list= static_cast<memcached_server_st*>(libmemcached_realloc(ptr, memcached_server_list(ptr),
363
363
                                                                                             sizeof(memcached_server_st) * (ptr->number_of_hosts + 1)));
364
364
 
365
 
  if (not new_host_list)
 
365
  if (new_host_list == NULL)
366
366
  {
367
 
    return MEMCACHED_MEMORY_ALLOCATION_FAILURE;
 
367
    return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT);
368
368
  }
369
369
 
370
370
  memcached_server_list_set(ptr, new_host_list);
372
372
  /* TODO: Check return type */
373
373
  memcached_server_write_instance_st instance= memcached_server_instance_fetch(ptr, memcached_server_count(ptr));
374
374
 
375
 
  if (not __server_create_with(ptr, instance, hostname, port, weight, type))
 
375
  if (__server_create_with(ptr, instance, hostname, port, weight, type) == NULL)
376
376
  {
377
377
    return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT);
378
378
  }