trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1166422 [3/3] - in /trafficserver/traffic/trunk: iocore/cache/ iocore/cluster/ iocore/dns/ iocore/eventsystem/ iocore/hostdb/ iocore/net/ iocore/utils/ lib/records/ lib/ts/ mgmt/ mgmt/api/ mgmt/api/remote/ mgmt/cli/ mgmt/cluster/ mgmt/stat...
Date Wed, 07 Sep 2011 21:46:07 GMT
Modified: trafficserver/traffic/trunk/proxy/ParentSelection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/ParentSelection.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/ParentSelection.cc (original)
+++ trafficserver/traffic/trunk/proxy/ParentSelection.cc Wed Sep  7 21:46:03 2011
@@ -149,9 +149,8 @@ ParentConfig::reconfigure()
   // Handle default parent
   PARENT_ReadConfigStringAlloc(default_val, default_var);
   params->DefaultParent = createDefaultParent(default_val);
-  if (default_val) {
-    xfree(default_val);
-  }
+  ats_free(default_val);
+
   // Handle parent timeout
   PARENT_ReadConfigInteger(retry_time, retry_var);
   params->ParentRetryTime = retry_time;
@@ -678,10 +677,9 @@ ParentRecord::ProcessParents(char *val)
   return NULL;
 
 MERROR:
-  if (parents != NULL) {
-    xfree(parents);
-    parents = NULL;
-  }
+  ats_free(parents);
+  parents = NULL;
+
   return errPtr;
 }
 
@@ -711,7 +709,7 @@ ParentRecord::DefaultInit(char *val)
     errBuf = (char *)ats_malloc(1024);
     snprintf(errBuf, 1024, "%s %s for default parent proxy", modulePrefix, errPtr);
     SignalError(errBuf, alarmAlready);
-    xfree(errBuf);
+    ats_free(errBuf);
     return false;
   } else {
     return true;
@@ -836,7 +834,7 @@ ParentRecord::UpdateMatch(ParentResult *
 
 ParentRecord::~ParentRecord()
 {
-  xfree(parents);
+  ats_free(parents);
 }
 
 void
@@ -994,9 +992,7 @@ SocksServerConfig::reconfigure()
   // Handle default parent
   PARENT_ReadConfigStringAlloc(default_val, "proxy.config.socks.default_servers");
   params->DefaultParent = createDefaultParent(default_val);
-  if (default_val) {
-    xfree(default_val);
-  }
+  ats_free(default_val);
 
   if (params->DefaultParent)
     setup_socks_servers(params->DefaultParent, 1);

Modified: trafficserver/traffic/trunk/proxy/Plugin.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Plugin.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Plugin.cc (original)
+++ trafficserver/traffic/trunk/proxy/Plugin.cc Wed Sep  7 21:46:03 2011
@@ -297,7 +297,7 @@ plugin_init(const char *config_dir, bool
     RecGetRecordString_Xmalloc("proxy.config.plugin.extensions_dir", (char**)&cfg);
     if (cfg != NULL) {
       extensions_dir = Layout::get()->relative(cfg);
-      xfree(cfg);
+      ats_free(cfg);
       cfg = NULL;
     }
     ink_filepath_make(path, sizeof(path), config_dir, "plugin.db");
@@ -373,11 +373,8 @@ plugin_init(const char *config_dir, bool
 
     plugin_load(argc, argv, internal);
 
-    for (i = 0; i < argc; i++) {
-      if (vars[i]) {
-        xfree(vars[i]);
-      }
-    }
+    for (i = 0; i < argc; i++)
+      ats_free(vars[i]);
   }
 
   close(fd);

Modified: trafficserver/traffic/trunk/proxy/Prefetch.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Prefetch.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Prefetch.cc (original)
+++ trafficserver/traffic/trunk/proxy/Prefetch.cc Wed Sep  7 21:46:03 2011
@@ -352,8 +352,7 @@ PrefetchTransform::~PrefetchTransform()
 
   if (m_output_buf)
     free_MIOBuffer(m_output_buf);
-  if (url)
-    xfree(url);
+  ats_free(url);
 }
 
 int
@@ -508,8 +507,8 @@ PrefetchTransform::redirect(HTTPHdr *res
       Debug("PrefetchTransform", "Redirect url to HTTP Hdr Location: \'%s\'\n", redirect_url);
       if (strncmp(redirect_url, req_url, location_len) == 0) {
         Debug("PrefetchTransform", "'%s' -> '%s' - Could be a loop. Discontinuing this path.\n", req_url, redirect_url);
-        xfree(redirect_url);
-        xfree(req_url);
+        ats_free(redirect_url);
+        ats_free(req_url);
         return 0;
       }
 
@@ -517,8 +516,8 @@ PrefetchTransform::redirect(HTTPHdr *res
 
       if (!entry) {
         Debug("PrefetchParserURLs", "Ignoring duplicate url '%s'", redirect_url);
-        xfree(redirect_url);
-        xfree(req_url);
+        ats_free(redirect_url);
+        ats_free(req_url);
         return 0;
       }
 
@@ -527,12 +526,10 @@ PrefetchTransform::redirect(HTTPHdr *res
 
       PrefetchBlaster *blaster = prefetchBlasterAllocator.alloc();
       blaster->init(entry, &m_sm->t_state.hdr_info.client_request, this);
-      if (req_url)
-        xfree(req_url);
+      ats_free(req_url);
     }
   }
-  if (redirect_url)
-    xfree(redirect_url);
+  ats_free(redirect_url);
   return 0;
 }
 
@@ -964,7 +961,7 @@ PrefetchBlaster::init(PrefetchUrlEntry *
     char *topurl = req_hdr->url_get()->string_get(NULL, &topurl_len);
     if (topurl) {
       request->value_set(MIME_FIELD_REFERER, MIME_LEN_REFERER, topurl, topurl_len);
-      xfree(topurl);
+      ats_free(topurl);
     }
   }
 
@@ -1110,8 +1107,7 @@ cookie_debug(const char *level, const ch
     memcpy(str, value, value_len);
     str[value_len] = 0;
     Debug("PrefetchCookies", "Processing %s value: %s", level, str);
-    if (str)
-      xfree(str);
+    ats_free(str);
   }
 }
 
@@ -1865,9 +1861,8 @@ PrefetchConfiguration::readConfiguration
     Warning("PrefetchProcessor: No prefetch configuration file specified. Prefetch disabled\n");
     goto Lerror;
   }
-  Layout::relative_to(conf_path, sizeof(conf_path),
-                      system_config_directory, conf_file_name);
-  xfree(conf_file_name);
+  Layout::relative_to(conf_path, sizeof(conf_path), system_config_directory, conf_file_name);
+  ats_free(conf_file_name);
 
   fd = open(conf_path, O_RDONLY);
   if (fd < 0) {
@@ -1878,7 +1873,7 @@ PrefetchConfiguration::readConfiguration
   char *temp_str;
   if ((temp_str = Load_IpMap_From_File(&ip_map, fd, "prefetch_children")) != 0) {
     Error("PrefetchProcessor: Error in reading ip_range from %s: %.256s\n", conf_path, temp_str);
-    xfree(temp_str);
+    ats_free(temp_str);
     goto Lerror;
   }
 

Modified: trafficserver/traffic/trunk/proxy/Prefetch.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Prefetch.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Prefetch.h (original)
+++ trafficserver/traffic/trunk/proxy/Prefetch.h Wed Sep  7 21:46:03 2011
@@ -140,8 +140,7 @@ inline void
 PrefetchUrlEntry::free()
 {
   if (refcount_dec() == 0) {
-    if (url)
-      xfree(url);
+    ats_free(url);
     prefetchUrlEntryAllocator.free(this);
   }
 }

Modified: trafficserver/traffic/trunk/proxy/Show.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Show.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Show.h (original)
+++ trafficserver/traffic/trunk/proxy/Show.h Wed Sep  7 21:46:03 2011
@@ -83,7 +83,7 @@ struct ShowCont: public Continuation
       action.continuation->handleEvent(STAT_PAGE_SUCCESS, &data);
       start = 0;
     } else {
-      xfree(start);
+      ats_free(start);
       start = NULL;
     }
     return done(VIO::CLOSE, event, e);
@@ -91,7 +91,7 @@ struct ShowCont: public Continuation
 
   int complete_error(int event, Event * e)
   {
-    xfree(start);
+    ats_free(start);
     start = NULL;
     if (!action.cancelled)
       action.continuation->handleEvent(STAT_PAGE_FAILURE, NULL);
@@ -115,7 +115,7 @@ struct ShowCont: public Continuation
     NOWARN_UNUSED(event);
     NOWARN_UNUSED(data);
     if (sarg) {
-      xfree(sarg);
+      ats_free(sarg);
       sarg = NULL;
     }
     delete this;
@@ -133,7 +133,7 @@ ShowCont(Continuation * c, HTTPHdr * h):
   }
   ~ShowCont() {
     if (start)
-      xfree(start);
+      ats_free(start);
   }
 };
 

Modified: trafficserver/traffic/trunk/proxy/StatPages.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/StatPages.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/StatPages.cc (original)
+++ trafficserver/traffic/trunk/proxy/StatPages.cc Wed Sep  7 21:46:03 2011
@@ -133,10 +133,7 @@ bool StatPagesManager::is_cache_inspecto
 void
 BaseStatPagesHandler::resp_clear()
 {
-  if (response) {
-    xfree(response);
-  }
-
+  ats_free(response);
   response = NULL;
   response_size = 0;
   response_length = 0;

Modified: trafficserver/traffic/trunk/proxy/StatSystem.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/StatSystem.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/StatSystem.cc (original)
+++ trafficserver/traffic/trunk/proxy/StatSystem.cc Wed Sep  7 21:46:03 2011
@@ -320,15 +320,13 @@ write_stats_snap()
     if (socketManager.write(fd, buf, buf_size) != buf_size)
       goto Lerror;
   }
-  if (buf)
-    xfree(buf);
+  ats_free(buf);
   //close(fd);
   socketManager.close(fd);
   Debug("stats", "snapped stats");
   return;
 Lerror:
-  if (buf)
-    xfree(buf);
+  ats_free(buf);
   Warning("unable to snap statistics");
   //close(fd);
   socketManager.close(fd);
@@ -419,7 +417,7 @@ stat_callback(Continuation * cont, HTTPH
 
   num_prefix_buffer = RecGetRecordPrefix_Xmalloc(var_prefix, &buffer, &buffer_len);
   empty = (num_prefix_buffer == 0);
-  xfree(var_prefix);
+  ats_free(var_prefix);
 
   if (!empty) {
 
@@ -440,14 +438,10 @@ stat_callback(Continuation * cont, HTTPH
     data.length = strlen(result);
     cont->handleEvent(STAT_PAGE_SUCCESS, &data);
   } else {
-    if (result) {
-      xfree(result);
-    }
+    ats_free(result);
     cont->handleEvent(STAT_PAGE_FAILURE, NULL);
   }
-
-  if (buffer)
-    xfree(buffer);
+  ats_free(buffer);
 
   return ACTION_RESULT_DONE;
 }

Modified: trafficserver/traffic/trunk/proxy/Stuffer.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Stuffer.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Stuffer.cc (original)
+++ trafficserver/traffic/trunk/proxy/Stuffer.cc Wed Sep  7 21:46:03 2011
@@ -379,7 +379,7 @@ StufferCacheWriter::free()
     StufferURLPromise *p = stuffer_htable->lookup(url);
     if (p)
       p->free(true);
-    xfree(url);
+    ats_free(url);
     url = 0;
   }
 
@@ -612,7 +612,7 @@ StufferURLPromise::free(bool obj_pushed)
   }
 
   stuffer_htable->remove(this);
-  xfree(url);
+  ats_free(url);
   stufferURLPromiseAllocator.free(this);
 }
 
@@ -721,7 +721,7 @@ StufferHashTable::add(char *url)
   StufferURLPromise **e = position(url);
   if (*e) {
     //right now we just neglect the URL
-    xfree(url);
+    ats_free(url);
     return;
   }
 

Modified: trafficserver/traffic/trunk/proxy/Update.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/Update.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/Update.cc (original)
+++ trafficserver/traffic/trunk/proxy/Update.cc Wed Sep  7 21:46:03 2011
@@ -232,17 +232,16 @@ _offset_hour(0), _interval(0), _max_dept
 
 UpdateEntry::~UpdateEntry()
 {
-  if (_url) {
-    xfree(_url);
-    _url = NULL;
-  }
+  ats_free(_url);
+  _url = NULL;
+
   if (_URLhandle.valid()) {
     _URLhandle.destroy();
   }
-  if (_request_headers) {
-    xfree(_request_headers);
-    _request_headers = NULL;
-  }
+
+  ats_free(_request_headers);
+  _request_headers = NULL;
+
   // INKqa12891: _http_hdr can be NULL
   if (_http_hdr && _http_hdr->valid()) {
     _http_hdr->destroy();

Modified: trafficserver/traffic/trunk/proxy/congest/Congestion.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/congest/Congestion.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/congest/Congestion.h (original)
+++ trafficserver/traffic/trunk/proxy/congest/Congestion.h Wed Sep  7 21:46:03 2011
@@ -165,10 +165,8 @@ CongestionControlRecord::cleanup()
     pRecord->put();
     pRecord = NULL;
   }
-  if (prefix)
-    xfree(prefix), prefix = NULL;
-  if (error_page)
-    xfree(error_page), error_page = NULL;
+  ats_free(prefix), prefix = NULL;
+  ats_free(error_page), error_page = NULL;
 }
 
 typedef unsigned short cong_hist_t;
@@ -424,7 +422,7 @@ m_M_congested(0), m_last_M_congested(0),
 inline CongestionEntry::~CongestionEntry()
 {
   if (m_hostname)
-    xfree(m_hostname), m_hostname = NULL;
+    ats_free(m_hostname), m_hostname = NULL;
   m_hist_lock = NULL;
   if (pRecord)
     pRecord->put(), pRecord = NULL;

Modified: trafficserver/traffic/trunk/proxy/congest/MT_hashtable.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/congest/MT_hashtable.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/congest/MT_hashtable.h (original)
+++ trafficserver/traffic/trunk/proxy/congest/MT_hashtable.h Wed Sep  7 21:46:03 2011
@@ -47,9 +47,10 @@ template<class key_t, class data_t> stru
   {
     return (HashTableEntry *)ats_malloc(sizeof(HashTableEntry));
   }
+
   static void free(HashTableEntry * entry)
   {
-    xfree(entry);
+    ats_free(entry);
   }
 };
 

Modified: trafficserver/traffic/trunk/proxy/hdrs/HdrHeap.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/hdrs/HdrHeap.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/hdrs/HdrHeap.cc (original)
+++ trafficserver/traffic/trunk/proxy/hdrs/HdrHeap.cc Wed Sep  7 21:46:03 2011
@@ -194,7 +194,7 @@ HdrHeap::destroy()
   if (m_size == HDR_HEAP_DEFAULT_SIZE) {
     hdrHeapAllocator.free_void(this);
   } else {
-    xfree(this);
+    ats_free(this);
   }
 }
 
@@ -1127,7 +1127,7 @@ HdrStrHeap::free()
   if (m_heap_size == HDR_STR_HEAP_DEFAULT_SIZE) {
     strHeapAllocator.free_void(this);
   } else {
-    xfree(this);
+    ats_free(this);
   }
 }
 

Modified: trafficserver/traffic/trunk/proxy/hdrs/HdrTest.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/hdrs/HdrTest.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/hdrs/HdrTest.cc (original)
+++ trafficserver/traffic/trunk/proxy/hdrs/HdrTest.cc Wed Sep  7 21:46:03 2011
@@ -916,22 +916,22 @@ comp_http_hdr(HTTPHdr * h1, HTTPHdr * h2
   p_index = p_dumpoffset = 0;
   rval = h1->print(h1_pbuf, h1_len, &p_index, &p_dumpoffset);
   if (rval != 1) {
-    xfree(h1_pbuf);
-    xfree(h2_pbuf);
+    ats_free(h1_pbuf);
+    ats_free(h2_pbuf);
     return "hdr print failed";
   }
 
   p_index = p_dumpoffset = 0;
   rval = h2->print(h2_pbuf, h2_len, &p_index, &p_dumpoffset);
   if (rval != 1) {
-    xfree(h1_pbuf);
-    xfree(h2_pbuf);
+    ats_free(h1_pbuf);
+    ats_free(h2_pbuf);
     return "hdr print failed";
   }
 
   rval = memcmp(h1_pbuf, h2_pbuf, h1_len);
-  xfree(h1_pbuf);
-  xfree(h2_pbuf);
+  ats_free(h1_pbuf);
+  ats_free(h2_pbuf);
 
   if (rval != 0) {
     return "compare failed";

Modified: trafficserver/traffic/trunk/proxy/hdrs/MIME.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/hdrs/MIME.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/hdrs/MIME.cc (original)
+++ trafficserver/traffic/trunk/proxy/hdrs/MIME.cc Wed Sep  7 21:46:03 2011
@@ -2141,7 +2141,7 @@ mime_field_value_extend_comma_val(HdrHea
 
   // (11) free up any temporary storage
   if (extended_len > sizeof(temp_buf))
-    xfree(temp_ptr);
+    ats_free(temp_ptr);
 }
 
 /*-------------------------------------------------------------------------
@@ -2330,8 +2330,7 @@ mime_scanner_init(MIMEScanner * scanner)
 void
 mime_scanner_clear(MIMEScanner * scanner)
 {
-  if (scanner->m_line)
-    xfree(scanner->m_line);
+  ats_free(scanner->m_line);
   _mime_scanner_init(scanner);
 }
 

Modified: trafficserver/traffic/trunk/proxy/http/HttpBodyFactory.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpBodyFactory.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpBodyFactory.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpBodyFactory.cc Wed Sep  7 21:46:03 2011
@@ -311,16 +311,14 @@ HttpBodyFactory::reconfigure()
   rec_err = RecGetRecordString_Xmalloc("proxy.config.body_factory.template_sets_dir", &s);
   all_found = all_found && (rec_err == REC_ERR_OKAY);
   if (rec_err == REC_ERR_OKAY) {
-    if (directory_of_template_sets) {
-      xfree(directory_of_template_sets);
-    }
+    ats_free(directory_of_template_sets);
     directory_of_template_sets = s;
     if ((err = stat(directory_of_template_sets, &st)) < 0) {
       if ((err = stat(system_config_directory, &st)) < 0) {
         Warning("Unable to stat() directory '%s': %d %d, %s", system_config_directory, err, errno, strerror(errno));
         Warning(" Please set 'proxy.config.body_factory.template_sets_dir' ");
       } else {
-        xfree(directory_of_template_sets);
+        ats_free(directory_of_template_sets);
         directory_of_template_sets = xstrdup(system_config_directory);
       }
     }
@@ -666,7 +664,7 @@ HttpBodyFactory::load_sets_from_director
     }
   }
 
-  xfree(entry_buffer);
+  ats_free(entry_buffer);
   closedir(dir);
 
   return (new_table_of_sets);
@@ -743,7 +741,7 @@ HttpBodyFactory::load_body_set_from_dire
       body_set->set_template_by_name(entry_buffer->d_name, tmpl);
     }
   }
-  xfree(entry_buffer);
+  ats_free(entry_buffer);
   closedir(dir);
   return (body_set);
 }
@@ -769,12 +767,9 @@ HttpBodySet::HttpBodySet()
 
 HttpBodySet::~HttpBodySet()
 {
-  if (set_name)
-    xfree(set_name);
-  if (content_language)
-    xfree(content_language);
-  if (content_charset)
-    xfree(content_charset);
+  ats_free(set_name);
+  ats_free(content_language);
+  ats_free(content_charset);
   if (table_of_pages)
     delete table_of_pages;
 }
@@ -865,12 +860,10 @@ HttpBodySet::init(char *set, char *dir)
     //////////////////////////////////////////////////
 
     if (strcasecmp(name, "Content-Language") == 0) {
-      if (this->content_language)
-        xfree(this->content_language);
+      ats_free(this->content_language);
       this->content_language = xstrdup(value);
     } else if (strcasecmp(name, "Content-Charset") == 0) {
-      if (this->content_charset)
-        xfree(this->content_charset);
+      ats_free(this->content_charset);
       this->content_charset = xstrdup(value);
     }
   }
@@ -946,12 +939,10 @@ HttpBodyTemplate::~HttpBodyTemplate()
 void
 HttpBodyTemplate::reset()
 {
-  if (template_buffer != NULL)
-    xfree(template_buffer);
+  ats_free(template_buffer);
   template_buffer = NULL;
   byte_count = 0;
-  if (template_pathname != NULL)
-    xfree(template_pathname);
+  ats_free(template_pathname);
 }
 
 
@@ -1003,7 +994,7 @@ HttpBodyTemplate::load_from_file(char *d
   if (bytes_read != new_byte_count) {
     Warning("reading template file '%s', got %d bytes instead of %d (%s)",
             path, bytes_read, new_byte_count, (strerror(errno) ? strerror(errno) : "unknown error"));
-    xfree(new_template_buffer);
+    ats_free(new_template_buffer);
     return (0);
   }
 

Modified: trafficserver/traffic/trunk/proxy/http/HttpConfig.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpConfig.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpConfig.h (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpConfig.h Wed Sep  7 21:46:03 2011
@@ -982,26 +982,23 @@ HttpConfigParams::HttpConfigParams()
 inline
 HttpConfigParams::~HttpConfigParams()
 {
-  xfree(proxy_hostname);
-  xfree(proxy_request_via_string);
-  xfree(proxy_response_via_string);
-  xfree(url_expansions_string);
-  xfree(proxy_server_other_ports);
-  xfree(anonymize_other_header_list);
-  xfree(global_user_agent_header);
-  xfree(oride.proxy_response_server_string);
-  xfree(cache_vary_default_text);
-  xfree(cache_vary_default_images);
-  xfree(cache_vary_default_other);
-  xfree(connect_ports_string);
-  xfree(reverse_proxy_no_host_redirect);
+  ats_free(proxy_hostname);
+  ats_free(proxy_request_via_string);
+  ats_free(proxy_response_via_string);
+  ats_free(url_expansions_string);
+  ats_free(proxy_server_other_ports);
+  ats_free(anonymize_other_header_list);
+  ats_free(global_user_agent_header);
+  ats_free(oride.proxy_response_server_string);
+  ats_free(cache_vary_default_text);
+  ats_free(cache_vary_default_images);
+  ats_free(cache_vary_default_other);
+  ats_free(connect_ports_string);
+  ats_free(reverse_proxy_no_host_redirect);
+  ats_free(url_expansions);
 
   if (connect_ports) {
     delete connect_ports;
   }
-
-  if (url_expansions) {
-    xfree(url_expansions);
-  }
 }
 #endif /* #ifndef _HttpConfig_h_ */

Modified: trafficserver/traffic/trunk/proxy/http/HttpMessageBody.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpMessageBody.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpMessageBody.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpMessageBody.cc Wed Sep  7 21:46:03 2011
@@ -67,8 +67,7 @@ HttpMessageBody::MakeErrorBodyVA(int64_t
 
   for (pass = 1; pass <= 2; pass++) {
     if (pass == 2) {
-      if (outbuf)
-        xfree(outbuf);
+      ats_free(outbuf);
       if (output_length > max_buffer_length)
         return (NULL);
       else

Modified: trafficserver/traffic/trunk/proxy/http/HttpProxyServerMain.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpProxyServerMain.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpProxyServerMain.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpProxyServerMain.cc Wed Sep  7 21:46:03 2011
@@ -281,7 +281,7 @@ start_HttpProxyServer(int fd, int port, 
       );
       opt.f_outbound_transparent = attr.f_outbound_transparent;
       opt.f_inbound_transparent = attr.f_inbound_transparent;
-      xfree(attr_string);
+      ats_free(attr_string);
     }
 
     netProcessor.main_accept(NEW(new HttpAccept(type)), fd,  NULL, NULL, false, false, opt);

Modified: trafficserver/traffic/trunk/proxy/http/HttpSM.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpSM.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpSM.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpSM.cc Wed Sep  7 21:46:03 2011
@@ -5435,7 +5435,7 @@ HttpSM::setup_internal_transfer(HttpSMHa
                                                  MIME_LEN_CONTENT_TYPE,
                                                  t_state.internal_msg_buffer_type,
                                                  strlen(t_state.internal_msg_buffer_type));
-      xfree(t_state.internal_msg_buffer_type);
+      ats_free(t_state.internal_msg_buffer_type);
       t_state.internal_msg_buffer_type = NULL;
     }
   } else {
@@ -6025,7 +6025,7 @@ HttpSM::kill_this()
     HTTP_SM_SET_DEFAULT_HANDLER(NULL);
 
     if (redirect_url != NULL) {
-      xfree(redirect_url);
+      ats_free(redirect_url);
       redirect_url = NULL;
       redirect_url_len = 0;
     }
@@ -6297,7 +6297,7 @@ HttpSM::dump_state_hdr(HTTPHdr *h, const
 
     hdr_buf[l] = '\0';
     Error("  ----  %s [%" PRId64 "] ----\n%s\n", s, sm_id, hdr_buf);
-    xfree(hdr_buf);
+    ats_free(hdr_buf);
   }
 }
 
@@ -6850,7 +6850,7 @@ HttpSM::do_redirect()
 
       if (redirect_url != NULL) {
         redirect_request(redirect_url, redirect_url_len);
-        xfree(redirect_url);
+        ats_free(redirect_url);
         redirect_url = NULL;
         redirect_url_len = 0;
         HTTP_INCREMENT_DYN_STAT(http_total_x_redirect_stat);
@@ -6934,7 +6934,7 @@ HttpSM::redirect_request(const char *red
       host_len += snprintf(buf + host_len, sizeof(buf) - host_len, ":%d", port);
       t_state.hdr_info.client_request.value_set(MIME_FIELD_HOST, MIME_LEN_HOST, buf, host_len);
 #if !defined(__GNUC__)
-      xfree(buf);
+      ats_free(buf);
 #endif
     } else {
       // the client request didn't have a host, so remove it from the headers

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransact.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransact.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransact.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransact.cc Wed Sep  7 21:46:03 2011
@@ -528,11 +528,11 @@ how_to_open_connection(HttpTransact::Sta
           strncpy(buf, host, host_len);
           host_len += snprintf(buf + host_len, host_len + 15, ":%d", port);
           s->hdr_info.server_request.value_set(MIME_FIELD_HOST, MIME_LEN_HOST, buf, host_len);
-          xfree(buf);
+          ats_free(buf);
         } else {
           s->hdr_info.server_request.value_set(MIME_FIELD_HOST, MIME_LEN_HOST, host, host_len);
         }
-        xfree(remap_redirect);  // This apparently shouldn't happen...
+        ats_free(remap_redirect);  // This apparently shouldn't happen...
       }
       // Stripping out the host name from the URL
       if (s->current.server == &s->server_info && s->next_hop_scheme == URL_WKSIDX_HTTP) {
@@ -547,11 +547,7 @@ how_to_open_connection(HttpTransact::Sta
       char *d_hst = (char *) s->hdr_info.server_request.value_get(MIME_FIELD_HOST, MIME_LEN_HOST, &host_len);
       if (d_hst)
         Debug("cdn", "Host Hdr: %s", d_hst);
-
-      if (d_url) {
-        //s->arena.str_free (d_url); <- vl: incorrect one sinse it was allocated without arena
-        xfree(d_url);
-      }
+      ats_free(d_url);
     }
     s->cdn_remap_complete = true;       // It doesn't matter if there was an actual remap or not
     s->transact_return_point = HttpTransact::OSDNSLookup;
@@ -850,7 +846,7 @@ HttpTransact::EndRemapRequest(State* s)
                            "\"<em>%s</em>\".<p>", s->remap_redirect);
     }
     s->hdr_info.client_response.value_set(MIME_FIELD_LOCATION, MIME_LEN_LOCATION, s->remap_redirect, strlen(s->remap_redirect));
-    xfree(s->remap_redirect);
+    ats_free(s->remap_redirect);
     s->reverse_proxy = false;
     goto done;
   }
@@ -1063,9 +1059,7 @@ HttpTransact::ModifyRequest(State* s)
       s->hdr_info.client_request.field_value_set(host_field, *host_val, host_val_len);
     }
 
-    if (buf)
-      xfree(buf);
-
+    ats_free(buf);
     request->mark_target_dirty();
   }
 
@@ -7815,7 +7809,7 @@ HttpTransact::build_request(State* s, HT
       strncpy(buf, host, host_len);
       host_len += snprintf(buf + host_len, host_len + 15, ":%d", port);
       outgoing_request->value_set(MIME_FIELD_HOST, MIME_LEN_HOST, buf, host_len);
-      xfree(buf);
+      ats_free(buf);
     } else {
       outgoing_request->value_set(MIME_FIELD_HOST, MIME_LEN_HOST, host, host_len);
     }

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransact.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransact.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransact.h (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransact.h Wed Sep  7 21:46:03 2011
@@ -1201,9 +1201,9 @@ public:
       if (internal_msg_buffer) {
         free_internal_msg_buffer(internal_msg_buffer, internal_msg_buffer_fast_allocator_size);
       }
-      //if (unmapped_request_url) xfree(unmapped_request_url);
+      //if (unmapped_request_url) ats_free(unmapped_request_url);
       if (internal_msg_buffer_type)
-        xfree(internal_msg_buffer_type);
+        ats_free(internal_msg_buffer_type);
 
       ParentConfig::release(parent_params);
       parent_params = NULL;
@@ -1411,7 +1411,7 @@ HttpTransact::free_internal_msg_buffer(c
   if (size >= 0) {
     ioBufAllocator[size].free_void(buffer);
   } else {
-    xfree(buffer);
+    ats_free(buffer);
   }
 }
 

Modified: trafficserver/traffic/trunk/proxy/http/HttpTransactHeaders.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/HttpTransactHeaders.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/HttpTransactHeaders.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/HttpTransactHeaders.cc Wed Sep  7 21:46:03 2011
@@ -158,8 +158,7 @@ HttpTransactHeaders::insert_supported_me
   field->value_append(response->m_heap, response->m_mime, value_buffer, bytes);
 
   // step 6: free up temp storage
-  if (alloced_buffer)
-    xfree(alloced_buffer);
+  ats_free(alloced_buffer);
 }
 
 

Modified: trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc Wed Sep  7 21:46:03 2011
@@ -27,7 +27,7 @@ remap_plugin_info::remap_plugin_info(cha
   :  next(0), path(NULL), path_size(0), dlh(NULL), fp_tsremap_init(NULL), fp_tsremap_done(NULL), fptsremap_new_instance(NULL),
      fp_tsremap_delete_instance(NULL), fp_tsremap_do_remap(NULL), fp_tsremap_os_response(NULL) 
 {
-  // coverity did not see xfree
+  // coverity did not see ats_free
   // coverity[ctor_dtor_leak]
   if (_path && likely((path = xstrdup(_path)) > 0))
     path_size = strlen(path);
@@ -35,7 +35,7 @@ remap_plugin_info::remap_plugin_info(cha
 
 remap_plugin_info::~remap_plugin_info()
 {
-  xfree(path);
+  ats_free(path);
   if (dlh)
     dlclose(dlh);
 }

Modified: trafficserver/traffic/trunk/proxy/http/remap/RemapPlugins.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/RemapPlugins.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/RemapPlugins.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/RemapPlugins.cc Wed Sep  7 21:46:03 2011
@@ -270,8 +270,7 @@ RemapPlugins::run_single_remap()
       redirect_url.destroy();
     }
 
-    if (unlikely(newPathAlloc))
-      xfree(newPathAlloc);
+    ats_free(newPathAlloc);
   }
 
 done:

Modified: trafficserver/traffic/trunk/proxy/http/remap/RemapProcessor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/RemapProcessor.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/RemapProcessor.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/RemapProcessor.cc Wed Sep  7 21:46:03 2011
@@ -265,7 +265,7 @@ RemapProcessor::finish_remap(HttpTransac
       if (old_host_hdr) {
         old_host_hdr = xstrndup(old_host_hdr, old_host_hdr_len);
         Debug("url_rewrite", "Host: Header before rewrite %.*s", old_host_hdr_len, old_host_hdr);
-        xfree(old_host_hdr);
+        ats_free(old_host_hdr);
       }
     }
     //

Modified: trafficserver/traffic/trunk/proxy/http/remap/StringHash.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/StringHash.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/StringHash.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/StringHash.cc Wed Sep  7 21:46:03 2011
@@ -167,8 +167,7 @@ StringHash::find_or_add(void *_ptr, cons
       he = NULL;
     }
   }
-  if (unlikely(tbuf_alloc))
-    xfree(tbuf_alloc);
+  ats_free(tbuf_alloc);
   return he;
 }
 

Modified: trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.cc Wed Sep  7 21:46:03 2011
@@ -222,8 +222,7 @@ regx_valid(false)
 **/
 referer_info::~referer_info()
 {
-  if (referer)
-    xfree(referer);
+  ats_free(referer);
   referer = 0;
   referer_size = 0;
 

Modified: trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.h (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.h Wed Sep  7 21:46:03 2011
@@ -70,7 +70,7 @@ public:
   {
     type = 0;
     if (chunk_str) {
-      xfree(chunk_str);
+      ats_free(chunk_str);
       chunk_str = NULL;
     }
   }

Modified: trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc (original)
+++ trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc Wed Sep  7 21:46:03 2011
@@ -526,7 +526,7 @@ UrlRewrite::UrlRewrite(const char *file_
   ink_strncpy(config_file_path, system_config_directory, sizeof(config_file_path));
   strncat(config_file_path, "/", sizeof(config_file_path) - strlen(config_file_path) - 1);
   strncat(config_file_path, config_file, sizeof(config_file_path) - strlen(config_file_path) - 1);
-  xfree(config_file);
+  ats_free(config_file);
 
   if (this->BuildTable() != 0) {
     Warning("something failed during BuildTable() -- check your remap plugins!");
@@ -542,9 +542,9 @@ UrlRewrite::UrlRewrite(const char *file_
 
 UrlRewrite::~UrlRewrite()
 {
-  xfree(this->file_var);
-  xfree(this->ts_name);
-  xfree(this->http_default_redirect_url);
+  ats_free(this->file_var);
+  ats_free(this->ts_name);
+  ats_free(this->http_default_redirect_url);
 
   DestroyStore(forward_mappings);
   DestroyStore(reverse_mappings);
@@ -1546,8 +1546,7 @@ UrlRewrite::BuildTable()
     forward_mappings_with_recv_port.hash_lookup = ink_hash_table_destroy(
       forward_mappings_with_recv_port.hash_lookup);
   }
-
-  xfree(file_buf);
+  ats_free(file_buf);
 
   return 0;
 }
@@ -1714,14 +1713,14 @@ UrlRewrite::load_remap_plugin(char *argv
     return -6;
   }
   parv[parc++] = xstrdup(err);
-  xfree(err);
+  ats_free(err);
 
   if ((err = mp->toUrl.string_get(NULL)) == NULL) {
     snprintf(errbuf, errbufsize, "Can't load toURL from URL class");
     return -6;
   }
   parv[parc++] = xstrdup(err);
-  xfree(err);
+  ats_free(err);
 
   bool plugin_encountered = false;
   // how many plugin parameters we have for this remapping
@@ -1758,8 +1757,8 @@ UrlRewrite::load_remap_plugin(char *argv
 
   Debug("remap_plugin", "done creating new plugin instance");
 
-  xfree(parv[0]);               // fromURL
-  xfree(parv[1]);               // toURL
+  ats_free(parv[0]);               // fromURL
+  ats_free(parv[1]);               // toURL
 
   if (res != TS_SUCCESS) {
     // TODO: This is such serious failure, no reason to try to delete the instance.

Modified: trafficserver/traffic/trunk/proxy/logcat.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logcat.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logcat.cc (original)
+++ trafficserver/traffic/trunk/proxy/logcat.cc Wed Sep  7 21:46:03 2011
@@ -322,7 +322,7 @@ main(int argc, char *argv[])
           out_filename[copy_len + ascii_ext_len] = 0;
 
           out_fd = open_output_file(out_filename);
-          xfree(out_filename);
+          ats_free(out_filename);
 
           if (out_fd < 0) {
             error = DATA_PROCESSING_ERROR;

Modified: trafficserver/traffic/trunk/proxy/logging/LogAccess.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogAccess.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogAccess.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogAccess.cc Wed Sep  7 21:46:03 2011
@@ -584,7 +584,7 @@ LogAccess::marshal_config_str_var(char *
   if (buf) {
     marshal_str(buf, str, len);
   }
-  xfree(str);
+  ats_free(str);
   return len;
 }
 
@@ -1239,7 +1239,7 @@ LogAccess::unmarshal_record(char **buf, 
 
   This function resolves the given custom log format string using the given
   LogAccess context and returns the resulting string, which is ats_malloc'd.
-  The caller is responsible for xfree'ing the return result.  If there are
+  The caller is responsible for ats_free'ing the return result.  If there are
   any problems, NULL is returned.
   -------------------------------------------------------------------------*/
 char *
@@ -1283,8 +1283,8 @@ resolve_logfield_string(LogAccess *conte
 
   if (field_count != n_fields) {
     Error("log-resolve", "format_str contains %d invalid field symbols", n_fields - field_count);
-    xfree(printf_str);
-    xfree(fields_str);
+    ats_free(printf_str);
+    ats_free(fields_str);
     return NULL;
   }
   //
@@ -1314,9 +1314,9 @@ resolve_logfield_string(LogAccess *conte
   ink_assert(bytes_resolved < 8192);
   result[bytes_resolved] = 0; // NULL terminate
 
-  xfree(printf_str);
-  xfree(fields_str);
-  xfree(buf);
+  ats_free(printf_str);
+  ats_free(fields_str);
+  ats_free(buf);
 
   return result;
 }

Modified: trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc Wed Sep  7 21:46:03 2011
@@ -789,8 +789,7 @@ LogBuffer::resolve_custom_entry(LogField
     }
   }
 
-  if (readfrom_map)
-    xfree(readfrom_map);
+  ats_free(readfrom_map);
   return bytes_written;
 }
 
@@ -887,12 +886,9 @@ LogBuffer::to_ascii(LogEntryHeader * ent
   }
 
   if (bad_alt_format) {
-    if (alt_fieldlist)
-      delete alt_fieldlist;
-    if (alt_printf_str)
-      xfree(alt_printf_str);
-    if (alt_symbol_str)
-      xfree(alt_symbol_str);
+    delete alt_fieldlist;
+    ats_free(alt_printf_str);
+    ats_free(alt_symbol_str);
     alt_fieldlist = NULL;
     alt_printf_str = NULL;
     alt_symbol_str = NULL;
@@ -903,12 +899,9 @@ LogBuffer::to_ascii(LogEntryHeader * ent
                                  entry->timestamp_usec, buffer_version,
                                  alt_fieldlist, alt_printf_str);
 
-  if (alt_fieldlist)
-    delete alt_fieldlist;
-  if (alt_printf_str)
-    xfree(alt_printf_str);
-  if (alt_symbol_str)
-    xfree(alt_symbol_str);
+  delete alt_fieldlist;
+  ats_free(alt_printf_str);
+  ats_free(alt_symbol_str);
 
   return ret;
 }

Modified: trafficserver/traffic/trunk/proxy/logging/LogBuffer.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogBuffer.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogBuffer.h (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogBuffer.h Wed Sep  7 21:46:03 2011
@@ -182,8 +182,7 @@ private:
 
   ~iLogBufferBuffer()
   {
-    if (buf)
-      xfree(buf);
+    ats_free(buf);
     real_buf_size = (size = 0);
   }
 

Modified: trafficserver/traffic/trunk/proxy/logging/LogConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogConfig.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogConfig.cc Wed Sep  7 21:46:03 2011
@@ -77,7 +77,7 @@
 extern "C"
 {
   int statvfs(const char *, struct statvfs *);
-};
+}
 #endif
 
 #define DISK_IS_CONFIG_FULL_MESSAGE \
@@ -213,32 +213,32 @@ LogConfig::read_configuration_variables(
   val = (int) LOG_ConfigReadInteger("proxy.config.log.log_buffer_size");
   if (val > 0) {
     log_buffer_size = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.max_entries_per_buffer");
   if (val > 0) {
     max_entries_per_buffer = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.max_secs_per_buffer");
   if (val > 0) {
     max_secs_per_buffer = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.max_space_mb_for_logs");
   if (val > 0) {
     max_space_mb_for_logs = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.max_space_mb_for_" "orphan_logs");
   if (val > 0) {
     max_space_mb_for_orphan_logs = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.max_space_mb_headroom");
   if (val > 0) {
     max_space_mb_headroom = val;
-  };
+  }
 
   // TODO: We should mover this "parser" to lib/ts
   ptr = LOG_ConfigReadString("proxy.config.log.logfile_perm");
@@ -271,23 +271,23 @@ LogConfig::read_configuration_variables(
     c++;
     if (*c == 'x')
       logfile_perm |= S_IXOTH;
-    xfree(ptr);
+    ats_free(ptr);
   }
 
   ptr = LOG_ConfigReadString("proxy.config.log.hostname");
   if (ptr != NULL) {
-    xfree(hostname);
+    ats_free(hostname);
     hostname = ptr;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.logfile_dir");
   if (ptr != NULL) {
-    xfree(logfile_dir);
+    ats_free(logfile_dir);
     // Make it relative from Layout
     logfile_dir = Layout::get()->relative(ptr);
-    xfree(ptr);
+    ats_free(ptr);
     if (access(logfile_dir, W_OK) == -1) {
-      xfree(logfile_dir);
+      ats_free(logfile_dir);
       logfile_dir = NULL;
       if (access(system_log_dir, W_OK) == -1) {
         // Try 'system_root_dir/var/log/trafficserver' directory
@@ -320,99 +320,99 @@ LogConfig::read_configuration_variables(
   val = (int) LOG_ConfigReadInteger("proxy.config.log.squid_log_enabled");
   if (val == 0 || val == 1) {
     squid_log_enabled = val;
-  };
+  }
 
   // X-UID logging enabled.
   val = (int) LOG_ConfigReadInteger("proxy.config.log.xuid_logging_enabledq");
   if (val == 0 || val == 1) {
     xuid_logging_enabled = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.squid_log_is_ascii");
   if (val == 0 || val == 1) {
     squid_log_is_ascii = val;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.squid_log_name");
   if (ptr != NULL) {
-    xfree(squid_log_name);
+    ats_free(squid_log_name);
     squid_log_name = ptr;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.squid_log_header");
   if (ptr != NULL) {
-    xfree(squid_log_header);
+    ats_free(squid_log_header);
     squid_log_header = ptr;
-  };
+  }
 
   // COMMON
   val = (int) LOG_ConfigReadInteger("proxy.config.log.common_log_enabled");
   if (val == 0 || val == 1) {
     common_log_enabled = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.common_log_is_ascii");
   if (val == 0 || val == 1) {
     common_log_is_ascii = val;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.common_log_name");
   if (ptr != NULL) {
-    xfree(common_log_name);
+    ats_free(common_log_name);
     common_log_name = ptr;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.common_log_header");
   if (ptr != NULL) {
-    xfree(common_log_header);
+    ats_free(common_log_header);
     common_log_header = ptr;
-  };
+  }
 
   // EXTENDED
   val = (int) LOG_ConfigReadInteger("proxy.config.log.extended_log_enabled");
   if (val == 0 || val == 1) {
     extended_log_enabled = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.extended_log_is_ascii");
   if (val == 0 || val == 1) {
     extended_log_is_ascii = val;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.extended_log_name");
   if (ptr != NULL) {
-    xfree(extended_log_name);
+    ats_free(extended_log_name);
     extended_log_name = ptr;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.extended_log_header");
   if (ptr != NULL) {
-    xfree(extended_log_header);
+    ats_free(extended_log_header);
     extended_log_header = ptr;
-  };
+  }
 
   // EXTENDED2
   val = (int) LOG_ConfigReadInteger("proxy.config.log.extended2_log_enabled");
   if (val == 0 || val == 1) {
     extended2_log_enabled = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.extended2_log_is_ascii");
   if (val == 0 || val == 1) {
     extended2_log_is_ascii = val;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.extended2_log_name");
   if (ptr != NULL) {
-    xfree(extended2_log_name);
+    ats_free(extended2_log_name);
     extended2_log_name = ptr;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.extended2_log_header");
   if (ptr != NULL) {
-    xfree(extended2_log_header);
+    ats_free(extended2_log_header);
     extended2_log_header = ptr;
-  };
+  }
 
 
   // SPLITTING
@@ -423,12 +423,12 @@ LogConfig::read_configuration_variables(
   val = (int) LOG_ConfigReadInteger("proxy.config.log.separate_icp_logs");
   if (val == 0 || val == 1 || val == -1) {
     separate_icp_logs = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.separate_host_logs");
   if (val == 0 || val == 1) {
     separate_host_logs = val;
-  };
+  }
 
 
   // COLLATION
@@ -439,35 +439,35 @@ LogConfig::read_configuration_variables(
 
   ptr = LOG_ConfigReadString("proxy.config.log.collation_host");
   if (ptr != NULL) {
-    xfree(collation_host);
+    ats_free(collation_host);
     collation_host = ptr;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.collation_port");
   if (val >= 0) {
     collation_port = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.collation_host_tagged");
   if (val == 0 || val == 1) {
     collation_host_tagged = val;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.collation_secret");
   if (ptr != NULL) {
-    xfree(collation_secret);
+    ats_free(collation_secret);
     collation_secret = ptr;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.collation_retry_sec");
   if (val >= 0) {
     collation_retry_sec = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.collation_max_send_buffers");
   if (val >= 0) {
     collation_max_send_buffers = val;
-  };
+  }
 
 
   // ROLLING
@@ -483,57 +483,57 @@ LogConfig::read_configuration_variables(
   val = (int) LOG_ConfigReadInteger("proxy.config.log." "auto_delete_rolled_files");
   if (val == 0 || val == 1) {
     auto_delete_rolled_files = val;
-  };
+  }
 
   // CUSTOM LOGGING
   val = (int) LOG_ConfigReadInteger("proxy.config.log.custom_logs_enabled");
   if (val == 0 || val == 1) {
     custom_logs_enabled = val;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.xml_config_file");
   if (ptr != NULL) {
-    xfree(xml_config_file);
+    ats_free(xml_config_file);
     xml_config_file = ptr;
-  };
+  }
 
   ptr = LOG_ConfigReadString("proxy.config.log.hosts_config_file");
   if (ptr != NULL) {
-    xfree(hosts_config_file);
+    ats_free(hosts_config_file);
     hosts_config_file = ptr;
-  };
+  }
 
   // PERFORMANCE
   val = (int) LOG_ConfigReadInteger("proxy.config.log.sampling_frequency");
   if (val > 0) {
     sampling_frequency = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.file_stat_frequency");
   if (val > 0) {
     file_stat_frequency = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.space_used_frequency");
   if (val > 0) {
     space_used_frequency = val;
-  };
+  }
 
   // ASCII BUFFER
   val = (int) LOG_ConfigReadInteger("proxy.config.log.ascii_buffer_size");
   if (val > 0) {
     ascii_buffer_size = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.max_line_size");
   if (val > 0) {
     max_line_size = val;
-  };
+  }
 
   val = (int) LOG_ConfigReadInteger("proxy.config.log.overspill_report_count");
   if (val > 0) {
     overspill_report_count = val;
-  };
+  }
 
 /* The following variables are initialized after reading the     */
 /* variable values from records.config                           */
@@ -637,23 +637,23 @@ LogConfig::~LogConfig()
 //    delete m_log_collation_accept;
 #endif
 
-  xfree(hostname);
-  xfree(logfile_dir);
-  xfree(squid_log_name);
-  xfree(squid_log_header);
-  xfree(common_log_name);
-  xfree(common_log_header);
-  xfree(extended_log_name);
-  xfree(extended_log_header);
-  xfree(extended2_log_name);
-  xfree(extended2_log_header);
-  xfree(collation_host);
-  xfree(collation_secret);
-  xfree(xml_config_file);
-  xfree(hosts_config_file);
-  xfree(search_log_file_one);
-  xfree(search_log_file_two);
-  xfree(m_dir_entry);
+  ats_free(hostname);
+  ats_free(logfile_dir);
+  ats_free(squid_log_name);
+  ats_free(squid_log_header);
+  ats_free(common_log_name);
+  ats_free(common_log_header);
+  ats_free(extended_log_name);
+  ats_free(extended_log_header);
+  ats_free(extended2_log_name);
+  ats_free(extended2_log_header);
+  ats_free(collation_host);
+  ats_free(collation_secret);
+  ats_free(xml_config_file);
+  ats_free(hosts_config_file);
+  ats_free(search_log_file_one);
+  ats_free(search_log_file_two);
+  ats_free(m_dir_entry);
 }
 
 /*-------------------------------------------------------------------------
@@ -1515,7 +1515,7 @@ LogConfig::update_space_used()
   // Clean up the candidate array
   //
   for (i = 0; i < candidate_count; i++) {
-    xfree(candidates[i].name);
+    ats_free(candidates[i].name);
   }
 
   //
@@ -1678,12 +1678,12 @@ LogConfig::read_xml_log_config(int from_
     nbytes = strlen(ptr);
     if (write(filedes[1], ptr, nbytes) != nbytes) {
       Note("Error in writing to pipe.");
-      xfree(ptr);
+      ats_free(ptr);
       close(filedes[1]);
       close(filedes[0]);
       return;
     }
-    xfree(ptr);
+    ats_free(ptr);
     close(filedes[1]);
 
     if (log_config.parse(filedes[0]) < 0) {

Modified: trafficserver/traffic/trunk/proxy/logging/LogField.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogField.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogField.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogField.cc Wed Sep  7 21:46:03 2011
@@ -159,8 +159,8 @@ LogField::LogField(const LogField &rhs)
   -------------------------------------------------------------------------*/
 LogField::~LogField()
 {
-  xfree(m_name);
-  xfree(m_symbol);
+  ats_free(m_name);
+  ats_free(m_symbol);
 }
 
 /*-------------------------------------------------------------------------

Modified: trafficserver/traffic/trunk/proxy/logging/LogFile.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogFile.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogFile.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogFile.cc Wed Sep  7 21:46:03 2011
@@ -132,8 +132,8 @@ LogFile::~LogFile()
   Debug("log-file", "entering LogFile destructor, this=%p", this);
   close_file();
 
-  xfree(m_name);
-  xfree(m_header);
+  ats_free(m_name);
+  ats_free(m_header);
   delete m_meta_info;
   delete[]m_ascii_buffer;
   m_ascii_buffer = 0;
@@ -160,7 +160,7 @@ bool LogFile::exists(const char *pathnam
 void
 LogFile::change_name(char *new_name)
 {
-  xfree(m_name);
+  ats_free(m_name);
   m_name = xstrdup(new_name);
 }
 
@@ -171,7 +171,7 @@ LogFile::change_name(char *new_name)
 void
 LogFile::change_header(const char *header)
 {
-  xfree(m_header);
+  ats_free(m_header);
   m_header = xstrdup(header);
 }
 

Modified: trafficserver/traffic/trunk/proxy/logging/LogFile.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogFile.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogFile.h (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogFile.h Wed Sep  7 21:46:03 2011
@@ -91,7 +91,7 @@ public:
   }
 
   ~MetaInfo() {
-    xfree(_filename);
+    ats_free(_filename);
   }
 
   bool get_creation_time(time_t * time)

Modified: trafficserver/traffic/trunk/proxy/logging/LogFilter.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogFilter.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogFilter.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogFilter.cc Wed Sep  7 21:46:03 2011
@@ -65,7 +65,7 @@ LogFilter::LogFilter(const char *name, L
   -------------------------------------------------------------------------*/
 LogFilter::~LogFilter()
 {
-  xfree(m_name);
+  ats_free(m_name);
   delete m_field;
 }
 
@@ -143,8 +143,8 @@ LogFilterString::~LogFilterString()
 {
   if (m_num_values > 0) {
     for (size_t i = 0; i < m_num_values; ++i) {
-      xfree(m_value[i]);
-      xfree(m_value_uppercase[i]);
+      ats_free(m_value[i]);
+      ats_free(m_value_uppercase[i]);
     }
     delete[]m_value;
     delete[]m_value_uppercase;
@@ -248,13 +248,8 @@ bool LogFilterString::toss_this_entry(Lo
     ink_assert(!"INVALID FILTER OPERATOR");
   }
 
-  if (big_buf) {
-    xfree(big_buf);
-  }
-
-  if (big_buf_upper) {
-    xfree(big_buf_upper);
-  }
+  ats_free(big_buf);
+  ats_free(big_buf_upper);
 
   return ((m_action == REJECT && cond_satisfied) || (m_action == ACCEPT && !cond_satisfied));
 }

Modified: trafficserver/traffic/trunk/proxy/logging/LogFormat.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogFormat.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogFormat.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogFormat.cc Wed Sep  7 21:46:03 2011
@@ -106,8 +106,8 @@ LogFormat::setup(const char *name, const
       m_valid = false;
     }
 
-    xfree(fieldlist_str);
-    xfree(printf_str);
+    ats_free(fieldlist_str);
+    ats_free(printf_str);
   }
 }
 
@@ -158,7 +158,7 @@ LogFormat::init_variables(const char *na
     }
 
     if (m_name_str) {
-      xfree(m_name_str);
+      ats_free(m_name_str);
       m_name_str = NULL;
       m_name_id = 0;
     }
@@ -168,7 +168,7 @@ LogFormat::init_variables(const char *na
     }
 
     if (m_fieldlist_str) {
-      xfree(m_fieldlist_str);
+      ats_free(m_fieldlist_str);
       m_fieldlist_str = NULL;
       m_fieldlist_id = 0;
     }
@@ -326,11 +326,11 @@ LogFormat::LogFormat(const LogFormat & r
 
 LogFormat::~LogFormat()
 {
-  xfree(m_name_str);
-  xfree(m_fieldlist_str);
-  xfree(m_printf_str);
-  xfree(m_agg_marshal_space);
-  xfree(m_format_str);
+  ats_free(m_name_str);
+  ats_free(m_fieldlist_str);
+  ats_free(m_printf_str);
+  ats_free(m_agg_marshal_space);
+  ats_free(m_format_str);
   m_valid = false;
 }
 
@@ -602,7 +602,7 @@ LogFormat::parse_symbol_string(const cha
     symbol = strtok(NULL, ",");
   }
 
-  xfree(sym_str);
+  ats_free(sym_str);
   return field_count;
 }
 

Modified: trafficserver/traffic/trunk/proxy/logging/LogHost.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogHost.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogHost.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogHost.cc Wed Sep  7 21:46:03 2011
@@ -91,7 +91,7 @@ LogHost::LogHost(const LogHost & rhs)
 LogHost::~LogHost()
 {
   clear();
-  xfree(m_object_filename);
+  ats_free(m_object_filename);
 }
 
 //
@@ -248,7 +248,7 @@ LogHost::create_orphan_LogFile_object()
   //
   m_orphan_file = NEW(new LogFile(name_buf, NULL, ASCII_LOG, m_object_signature));
   ink_assert(m_orphan_file != NULL);
-  xfree(name_buf);
+  ats_free(name_buf);
 }
 
 #ifndef TS_MICRO
@@ -287,14 +287,10 @@ LogHost::clear()
 
   disconnect();
 
-  if (m_name)
-    xfree(m_name);
-  if (m_ipstr)
-    xfree(m_ipstr);
-  if (m_sock)
-    delete m_sock;
-  if (m_orphan_file)
-    delete m_orphan_file;
+  ats_free(m_name);
+  ats_free(m_ipstr);
+  delete m_sock;
+  delete m_orphan_file;
 
   m_ip = 0;
   m_ipstr = NULL;

Modified: trafficserver/traffic/trunk/proxy/logging/LogObject.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogObject.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogObject.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogObject.cc Wed Sep  7 21:46:03 2011
@@ -186,9 +186,9 @@ LogObject::~LogObject()
     }
   }
   delete m_logFile;
-  xfree(m_basename);
-  xfree(m_filename);
-  xfree(m_alt_filename);
+  ats_free(m_basename);
+  ats_free(m_filename);
+  ats_free(m_alt_filename);
   delete m_format;
   delete m_log_buffer;
 }
@@ -273,7 +273,7 @@ LogObject::rename(char *new_name)
   // while solving filename conflicts. It DOES NOT modify the signature of
   // the LogObject to match the new filename.
   //
-  xfree(m_alt_filename);
+  ats_free(m_alt_filename);
   m_alt_filename = xstrdup(new_name);
   m_logFile->change_name(new_name);
 }
@@ -343,7 +343,7 @@ uint64_t LogObject::compute_signature(Lo
     md5s.encodeBuffer(buffer, buf_size - 1);
     signature = md5s.fold();
 
-    xfree(buffer);
+    ats_free(buffer);
   }
   return signature;
 }

Modified: trafficserver/traffic/trunk/proxy/logging/LogStandalone.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logging/LogStandalone.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logging/LogStandalone.cc (original)
+++ trafficserver/traffic/trunk/proxy/logging/LogStandalone.cc Wed Sep  7 21:46:03 2011
@@ -204,8 +204,7 @@ check_lockfile(const char *config_dir, c
     }
     _exit(1);
   }
-  xfree(lockfile);
-
+  ats_free(lockfile);
 }
 
 /*-------------------------------------------------------------------------

Modified: trafficserver/traffic/trunk/proxy/logstats.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/logstats.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/logstats.cc (original)
+++ trafficserver/traffic/trunk/proxy/logstats.cc Wed Sep  7 21:46:03 2011
@@ -463,8 +463,7 @@ public:
         } else {
           l = _cur++;
         }
-        if (l->url)
-          xfree(const_cast<char*>(l->url)); // We no longer own this string.
+        ats_free(const_cast<char*>(l->url)); // We no longer own this string.
       } else {
         l = _stack.insert(l, UrlStats()); // This seems faster than having a static "template" ...
       }
@@ -538,7 +537,7 @@ private:
   {
     for (LruStack::iterator l=_stack.begin(); l != _stack.end(); ++l) {
       if (free && l->url)
-        xfree(const_cast<char*>(l->url));
+        ats_free(const_cast<char*>(l->url));
       memset(&(*l), 0, sizeof(UrlStats));
     }
   }



Mime
View raw message