~yeban/libmemcached/todo-hosts.c-2

« back to all changes in this revision

Viewing changes to libmemcached/hosts.c

  • Committer: Anurag Priyam
  • Date: 2011-04-11 08:39:56 UTC
  • Revision ID: anurag08priyam@gmail.com-20110411083956-8hajovqqi8elmocp
check return type of memcached_server_create_with in server_add

Show diffs side-by-side

added added

removed removed

Lines of Context:
439
439
 
440
440
  memcached_server_list_set(ptr, new_host_list);
441
441
 
442
 
  /* TODO: Check return type */
443
442
  instance= memcached_server_instance_fetch(ptr, memcached_server_count(ptr));
444
 
  (void)memcached_server_create_with(ptr, instance, hostname, port, weight, type);
 
443
  WATCHPOINT_ASSERT(instance);
 
444
 
 
445
  instance= memcached_server_create_with(ptr, instance, hostname, port, weight, type);
 
446
  if (! instance)
 
447
  {
 
448
      return memcached_set_error(ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, NULL);
 
449
  }
445
450
  ptr->number_of_hosts++;
446
451
 
447
452
  instance= memcached_server_instance_fetch(ptr, 0);