<commit_before>/*
  This is a partial implementation for fetching/creating memcached_server_st objects.
*/
#include "common.h"

memcached_server_st *memcached_server_create(memcached_st *memc, memcached_server_st *ptr)
{
  if (ptr == NULL)
  {
    ptr= (memcached_server_st *)malloc(sizeof(memcached_server_st));

    if (!ptr)
      return NULL; /*  MEMCACHED_MEMORY_ALLOCATION_FAILURE */

    memset(ptr, 0, sizeof(memcached_server_st));
    ptr->is_allocated= MEMCACHED_ALLOCATED;
  }
  else
  {
    memset(ptr, 0, sizeof(memcached_server_st));
  }
  
  ptr->root= memc;

  return ptr;
}

void memcached_server_free(memcached_server_st *ptr)
{
  memcached_return rc;
  WATCHPOINT_ASSERT(ptr->is_allocated != MEMCACHED_NOT_ALLOCATED);

  rc= memcached_io_close(ptr);
  WATCHPOINT_ASSERT(rc == MEMCACHED_SUCCESS);

  if (ptr->address_info)
  {
    freeaddrinfo(ptr->address_info);
    ptr->address_info= NULL;
  }

  if (ptr->is_allocated == MEMCACHED_ALLOCATED)
  {
    if (ptr->root && ptr->root->call_free)
      ptr->root->call_free(ptr->root, ptr);
    else
      free(ptr);
  }<commit_msg>Straighten up exection path<commit_after>/*
  This is a partial implementation for fetching/creating memcached_server_st objects.
*/
#include "common.h"

memcached_server_st *memcached_server_create(memcached_st *memc, memcached_server_st *ptr)
{
  if (ptr == NULL)
  {
    ptr= (memcached_server_st *)malloc(sizeof(memcached_server_st));

    if (!ptr)
      return NULL; /*  MEMCACHED_MEMORY_ALLOCATION_FAILURE */

    memset(ptr, 0, sizeof(memcached_server_st));
    ptr->is_allocated= MEMCACHED_ALLOCATED;
  }
  else
  {
    memset(ptr, 0, sizeof(memcached_server_st));
  }
  
  ptr->root= memc;

  return ptr;
}

void memcached_server_free(memcached_server_st *ptr)
{
  memcached_return rc;
  WATCHPOINT_ASSERT(ptr->is_allocated != MEMCACHED_NOT_ALLOCATED);

  memcached_quit_server(ptr, 0);

  if (ptr->address_info)
  {
    freeaddrinfo(ptr->address_info);
    ptr->address_info= NULL;
  }

  if (ptr->is_allocated == MEMCACHED_ALLOCATED)
  {
    if (ptr->root && ptr->root->call_free)
      ptr->root->call_free(ptr->root, ptr);
    else
      free(ptr);
  }
{'fraction_non_alphanumeric': 0.12349676225716928, 'fraction_numerical': 0.002312673450508788, 'mean_word_length': 4.18705035971223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4988120', 'n_tokens_mistral': 821, 'n_tokens_neox': 802, 'n_words': 135}