trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject svn commit: r1166422 [1/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
Author: zwoop
Date: Wed Sep  7 21:46:03 2011
New Revision: 1166422

URL: http://svn.apache.org/viewvc?rev=1166422&view=rev
Log:
TS-567 Change xfree to ats_free

Modified:
    trafficserver/traffic/trunk/iocore/cache/Cache.cc
    trafficserver/traffic/trunk/iocore/cache/CacheDir.cc
    trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc
    trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc
    trafficserver/traffic/trunk/iocore/cache/CacheWrite.cc
    trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h
    trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h
    trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc
    trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc
    trafficserver/traffic/trunk/iocore/cache/Store.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterLoadMonitor.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc
    trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc
    trafficserver/traffic/trunk/iocore/dns/DNS.cc
    trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc
    trafficserver/traffic/trunk/iocore/eventsystem/P_Freer.h
    trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h
    trafficserver/traffic/trunk/iocore/eventsystem/Thread.cc
    trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc
    trafficserver/traffic/trunk/iocore/hostdb/MultiCache.cc
    trafficserver/traffic/trunk/iocore/net/NetVCTest.cc
    trafficserver/traffic/trunk/iocore/net/P_Socks.h
    trafficserver/traffic/trunk/iocore/net/SSLCertLookup.cc
    trafficserver/traffic/trunk/iocore/net/SSLConfig.cc
    trafficserver/traffic/trunk/iocore/net/Socks.cc
    trafficserver/traffic/trunk/iocore/utils/Machine.cc
    trafficserver/traffic/trunk/lib/records/I_RecCore.h
    trafficserver/traffic/trunk/lib/records/P_RecCore.i
    trafficserver/traffic/trunk/lib/records/RecCompatibility.cc
    trafficserver/traffic/trunk/lib/records/RecCore.cc
    trafficserver/traffic/trunk/lib/records/RecMessage.cc
    trafficserver/traffic/trunk/lib/records/RecTree.cc
    trafficserver/traffic/trunk/lib/records/RecUtils.cc
    trafficserver/traffic/trunk/lib/ts/Arena.cc
    trafficserver/traffic/trunk/lib/ts/Diags.cc
    trafficserver/traffic/trunk/lib/ts/HostLookup.cc
    trafficserver/traffic/trunk/lib/ts/HostLookup.h
    trafficserver/traffic/trunk/lib/ts/I_Layout.h
    trafficserver/traffic/trunk/lib/ts/Layout.cc
    trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc
    trafficserver/traffic/trunk/lib/ts/TextBuffer.cc
    trafficserver/traffic/trunk/lib/ts/Tokenizer.cc
    trafficserver/traffic/trunk/lib/ts/ink_base64.h
    trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc
    trafficserver/traffic/trunk/lib/ts/ink_killall.cc
    trafficserver/traffic/trunk/lib/ts/ink_memory.cc
    trafficserver/traffic/trunk/lib/ts/ink_resource.cc
    trafficserver/traffic/trunk/lib/ts/ink_resource.h
    trafficserver/traffic/trunk/lib/ts/ink_string++.cc
    trafficserver/traffic/trunk/lib/ts/ink_string.cc
    trafficserver/traffic/trunk/lib/ts/llqueue.cc
    trafficserver/traffic/trunk/lib/ts/lockfile.cc
    trafficserver/traffic/trunk/mgmt/Alarms.cc
    trafficserver/traffic/trunk/mgmt/BaseManager.cc
    trafficserver/traffic/trunk/mgmt/FileManager.cc
    trafficserver/traffic/trunk/mgmt/LocalManager.cc
    trafficserver/traffic/trunk/mgmt/LocalManager.h
    trafficserver/traffic/trunk/mgmt/Main.cc
    trafficserver/traffic/trunk/mgmt/MultiFile.cc
    trafficserver/traffic/trunk/mgmt/ProcessManager.cc
    trafficserver/traffic/trunk/mgmt/ProcessManager.h
    trafficserver/traffic/trunk/mgmt/Rollback.cc
    trafficserver/traffic/trunk/mgmt/Rollback.h
    trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc
    trafficserver/traffic/trunk/mgmt/api/CfgContextManager.cc
    trafficserver/traffic/trunk/mgmt/api/CfgContextUtils.cc
    trafficserver/traffic/trunk/mgmt/api/CoreAPI.cc
    trafficserver/traffic/trunk/mgmt/api/EventCallback.cc
    trafficserver/traffic/trunk/mgmt/api/EventControlMain.cc
    trafficserver/traffic/trunk/mgmt/api/GenericParser.cc
    trafficserver/traffic/trunk/mgmt/api/INKMgmtAPI.cc
    trafficserver/traffic/trunk/mgmt/api/NetworkUtilsLocal.cc
    trafficserver/traffic/trunk/mgmt/api/TSControlMain.cc
    trafficserver/traffic/trunk/mgmt/api/remote/APITestCliRemote.cc
    trafficserver/traffic/trunk/mgmt/api/remote/CoreAPIRemote.cc
    trafficserver/traffic/trunk/mgmt/api/remote/NetworkUtilsRemote.cc
    trafficserver/traffic/trunk/mgmt/cli/CliMgmtUtils.cc
    trafficserver/traffic/trunk/mgmt/cluster/ClusterCom.cc
    trafficserver/traffic/trunk/mgmt/cluster/VMap.cc
    trafficserver/traffic/trunk/mgmt/stats/StatType.cc
    trafficserver/traffic/trunk/mgmt/tools/ConfigAPI.cc
    trafficserver/traffic/trunk/mgmt/tools/SysAPI.cc
    trafficserver/traffic/trunk/mgmt/utils/ExpandingArray.cc
    trafficserver/traffic/trunk/mgmt/utils/MgmtSchema.cc
    trafficserver/traffic/trunk/mgmt/utils/MgmtUtils.cc
    trafficserver/traffic/trunk/mgmt/utils/WebMgmtUtils.cc
    trafficserver/traffic/trunk/mgmt/web2/WebCompatibility.cc
    trafficserver/traffic/trunk/mgmt/web2/WebHttp.cc
    trafficserver/traffic/trunk/mgmt/web2/WebHttpContext.cc
    trafficserver/traffic/trunk/mgmt/web2/WebHttpMessage.cc
    trafficserver/traffic/trunk/mgmt/web2/WebHttpSession.cc
    trafficserver/traffic/trunk/mgmt/web2/WebIntrMain.cc
    trafficserver/traffic/trunk/mgmt/web2/WebOverview.cc
    trafficserver/traffic/trunk/proxy/ControlMatcher.cc
    trafficserver/traffic/trunk/proxy/CoreUtils.cc
    trafficserver/traffic/trunk/proxy/CoreUtils.h
    trafficserver/traffic/trunk/proxy/DiagsConfig.cc
    trafficserver/traffic/trunk/proxy/FetchSM.cc
    trafficserver/traffic/trunk/proxy/Freer.h
    trafficserver/traffic/trunk/proxy/ICP.cc
    trafficserver/traffic/trunk/proxy/IPAllow.cc
    trafficserver/traffic/trunk/proxy/InkAPI.cc
    trafficserver/traffic/trunk/proxy/InkAPITest.cc
    trafficserver/traffic/trunk/proxy/InkXml.cc
    trafficserver/traffic/trunk/proxy/Main.cc
    trafficserver/traffic/trunk/proxy/ParentSelection.cc
    trafficserver/traffic/trunk/proxy/Plugin.cc
    trafficserver/traffic/trunk/proxy/Prefetch.cc
    trafficserver/traffic/trunk/proxy/Prefetch.h
    trafficserver/traffic/trunk/proxy/Show.h
    trafficserver/traffic/trunk/proxy/StatPages.cc
    trafficserver/traffic/trunk/proxy/StatSystem.cc
    trafficserver/traffic/trunk/proxy/Stuffer.cc
    trafficserver/traffic/trunk/proxy/Update.cc
    trafficserver/traffic/trunk/proxy/congest/Congestion.h
    trafficserver/traffic/trunk/proxy/congest/MT_hashtable.h
    trafficserver/traffic/trunk/proxy/hdrs/HdrHeap.cc
    trafficserver/traffic/trunk/proxy/hdrs/HdrTest.cc
    trafficserver/traffic/trunk/proxy/hdrs/MIME.cc
    trafficserver/traffic/trunk/proxy/http/HttpBodyFactory.cc
    trafficserver/traffic/trunk/proxy/http/HttpConfig.h
    trafficserver/traffic/trunk/proxy/http/HttpMessageBody.cc
    trafficserver/traffic/trunk/proxy/http/HttpProxyServerMain.cc
    trafficserver/traffic/trunk/proxy/http/HttpSM.cc
    trafficserver/traffic/trunk/proxy/http/HttpTransact.cc
    trafficserver/traffic/trunk/proxy/http/HttpTransact.h
    trafficserver/traffic/trunk/proxy/http/HttpTransactHeaders.cc
    trafficserver/traffic/trunk/proxy/http/remap/RemapPluginInfo.cc
    trafficserver/traffic/trunk/proxy/http/remap/RemapPlugins.cc
    trafficserver/traffic/trunk/proxy/http/remap/RemapProcessor.cc
    trafficserver/traffic/trunk/proxy/http/remap/StringHash.cc
    trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.cc
    trafficserver/traffic/trunk/proxy/http/remap/UrlMapping.h
    trafficserver/traffic/trunk/proxy/http/remap/UrlRewrite.cc
    trafficserver/traffic/trunk/proxy/logcat.cc
    trafficserver/traffic/trunk/proxy/logging/LogAccess.cc
    trafficserver/traffic/trunk/proxy/logging/LogBuffer.cc
    trafficserver/traffic/trunk/proxy/logging/LogBuffer.h
    trafficserver/traffic/trunk/proxy/logging/LogConfig.cc
    trafficserver/traffic/trunk/proxy/logging/LogField.cc
    trafficserver/traffic/trunk/proxy/logging/LogFile.cc
    trafficserver/traffic/trunk/proxy/logging/LogFile.h
    trafficserver/traffic/trunk/proxy/logging/LogFilter.cc
    trafficserver/traffic/trunk/proxy/logging/LogFormat.cc
    trafficserver/traffic/trunk/proxy/logging/LogHost.cc
    trafficserver/traffic/trunk/proxy/logging/LogObject.cc
    trafficserver/traffic/trunk/proxy/logging/LogStandalone.cc
    trafficserver/traffic/trunk/proxy/logstats.cc

Modified: trafficserver/traffic/trunk/iocore/cache/Cache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Cache.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Cache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Cache.cc Wed Sep  7 21:46:03 2011
@@ -629,7 +629,7 @@ CacheProcessor::diskInitialized()
           p_good_disks[insert_at++] = gdisks[i];
         }
       }
-      xfree(gdisks);
+      ats_free(gdisks);
       gdisks = p_good_disks;
       gndisks = gndisks - bad_disks;
     }
@@ -1579,8 +1579,8 @@ build_vol_hash_table(CacheHostRecord *cp
       new_Freer(cp->vol_hash_table, CACHE_MEM_FREE_TIMEOUT);
     }
     cp->vol_hash_table = NULL;
-    xfree(mapping);
-    xfree(p);
+    ats_free(mapping);
+    ats_free(p);
     return;
   }
 
@@ -1625,8 +1625,8 @@ build_vol_hash_table(CacheHostRecord *cp
   if (cp->vol_hash_table) {
     new_Freer(cp->vol_hash_table, CACHE_MEM_FREE_TIMEOUT);
   }
-  xfree(mapping);
-  xfree(p);
+  ats_free(mapping);
+  ats_free(p);
   cp->vol_hash_table = ttable;
 }
 

Modified: trafficserver/traffic/trunk/iocore/cache/CacheDir.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/CacheDir.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/CacheDir.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/CacheDir.cc Wed Sep  7 21:46:03 2011
@@ -1160,7 +1160,7 @@ Vol::dir_check(bool fix)
       printf("\n" "                           ");
   }
   printf("\n");
-  ::xfree(shist);
+  ats_free(shist);
   return 0;
 }
 

Modified: trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/CacheDisk.cc Wed Sep  7 21:46:03 2011
@@ -79,14 +79,14 @@ CacheDisk::open(char *s, off_t blocks, o
 CacheDisk::~CacheDisk()
 {
   if (path) {
-    xfree(path);
+    ats_free(path);
     for (int i = 0; i < (int) header->num_volumes; i++) {
       DiskVolBlockQueue *q = NULL;
       while (disk_vols[i] && (q = (disk_vols[i]->dpb_queue.pop()))) {
         delete q;
       }
     }
-    xfree(disk_vols);
+    ats_free(disk_vols);
     free(header);
   }
   if (free_blocks) {

Modified: trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/CacheHosting.cc Wed Sep  7 21:46:03 2011
@@ -135,7 +135,7 @@ CacheHostMatcher::Match(char *rdata, int
 
     r = host_lookup->MatchNext(&s, &opaque_ptr);
   }
-  xfree(data);
+  ats_free(data);
 }
 
 //
@@ -208,7 +208,7 @@ CacheHostTable::CacheHostTable(Cache * c
   ink_release_assert(config_file != NULL);
   Layout::relative_to(config_file_path, sizeof(config_file_path),
                       cache_system_config_directory, config_file);
-  xfree(config_file);
+  ats_free(config_file);
   hostMatch = NULL;
 
   m_numEntries = this->BuildTable();
@@ -313,7 +313,7 @@ CacheHostTable::BuildTableFromString(cha
         snprintf(errBuf, sizeof(errBuf), "%s discarding %s entry at line %d : %s",
                  matcher_name, config_file_path, line_num, errPtr);
         IOCORE_SignalError(errBuf, alarmAlready);
-        xfree(current);
+        ats_free(current);
       } else {
 
         // Line parsed ok.  Figure out what the destination
@@ -353,7 +353,7 @@ CacheHostTable::BuildTableFromString(cha
     }
 
     if (first != NULL) {
-      xfree(first);
+      ats_free(first);
     }
     return 0;
   }
@@ -401,7 +401,7 @@ CacheHostTable::BuildTableFromString(cha
     // Deallocate the parsing structure
     last = current;
     current = current->next;
-    xfree(last);
+    ats_free(last);
   }
 
   if (!generic_rec_initd) {
@@ -437,7 +437,7 @@ CacheHostTable::BuildTable()
   }
 
   ret = BuildTableFromString(file_buf);
-  xfree(file_buf);
+  ats_free(file_buf);
   return ret;
 }
 
@@ -522,7 +522,7 @@ CacheHostRecord::Init(matcher_line * lin
                          "[CacheHosting]", config_file, line_info->line_num, errptr);
             IOCORE_SignalError(err, alarmAlready);
             if (val != NULL) {
-              xfree(val);
+              ats_free(val);
             }
             return -1;
           }
@@ -533,7 +533,7 @@ CacheHostRecord::Init(matcher_line * lin
                        "[CacheHosting]", config_file, line_info->line_num, *s);
           IOCORE_SignalError(err, alarmAlready);
           if (val != NULL) {
-            xfree(val);
+            ats_free(val);
           }
           return -1;
         }
@@ -571,7 +571,7 @@ CacheHostRecord::Init(matcher_line * lin
                          "[CacheHosting]", config_file, line_info->line_num, volume_number);
             IOCORE_SignalError(err, alarmAlready);
             if (val != NULL) {
-              xfree(val);
+              ats_free(val);
             }
             return -1;
           }
@@ -582,7 +582,7 @@ CacheHostRecord::Init(matcher_line * lin
         s++;
       }
       if (val != NULL) {
-        xfree(val);
+        ats_free(val);
       }
       break;
     }
@@ -647,7 +647,7 @@ ConfigVolumes::read_config_file()
   ink_release_assert(config_file != NULL);
   Layout::relative_to(config_file_path, sizeof(config_file_path),
                       cache_system_config_directory, config_file);
-  xfree(config_file);
+  ats_free(config_file);
 
   file_buf = readIntoBuffer(config_file_path, "[CacheVolition]", NULL);
 
@@ -657,7 +657,7 @@ ConfigVolumes::read_config_file()
   }
 
   BuildListFromString(config_file_path, file_buf);
-  xfree(file_buf);
+  ats_free(file_buf);
   return;
 }
 
@@ -1186,10 +1186,8 @@ ClearCacheVolList(Queue<CacheVol> *cpl, 
   int i = 0;
   CacheVol *cp = NULL;
   while ((cp = cpl->dequeue())) {
-    if (cp->disk_vols)
-      xfree(cp->disk_vols);
-    if (cp->vols)
-      xfree(cp->vols);
+    ats_free(cp->disk_vols);
+    ats_free(cp->vols);
     delete(cp);
     i++;
   }

Modified: trafficserver/traffic/trunk/iocore/cache/CacheWrite.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/CacheWrite.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/CacheWrite.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/CacheWrite.cc Wed Sep  7 21:46:03 2011
@@ -1234,7 +1234,7 @@ CacheVC::openWriteCloseDataDone(int even
           frag = (Frag*)ats_malloc(sizeof(Frag) * (fragment-1)*2);
           memcpy(frag, t, sizeof(Frag) * (fragment-1));
           if (t != integral_frags)
-            xfree(t);
+            ats_free(t);
         }
       }
       frag[fragment-1].offset = write_pos;
@@ -1336,7 +1336,7 @@ CacheVC::openWriteWriteDone(int event, E
           frag = (Frag*)ats_malloc(sizeof(Frag) * (fragment-1)*2);
           memcpy(frag, t, sizeof(Frag) * (fragment-1));
           if (t != integral_frags)
-            xfree(t);
+            ats_free(t);
         }
       }
       frag[fragment-1].offset = write_pos;

Modified: trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CacheHosting.h Wed Sep  7 21:46:03 2011
@@ -41,12 +41,9 @@ struct CacheHostRecord
   void Print();
   ~CacheHostRecord()
   {
-    if (vols)
-      xfree(vols);
-    if (vol_hash_table)
-      xfree(vol_hash_table);
-    if (cp)
-      xfree(cp);
+    ats_free(vols);
+    ats_free(vol_hash_table);
+    ats_free(cp);
   }
 
   int type;

Modified: trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h Wed Sep  7 21:46:03 2011
@@ -593,9 +593,9 @@ free_CacheVC(CacheVC *cont)
   cont->writer_buf.clear();
   cont->alternate_index = CACHE_ALT_INDEX_DEFAULT;
   if (cont->frag && cont->frag != cont->integral_frags)
-    xfree(cont->frag);
+    ats_free(cont->frag);
   if (cont->scan_vol_map)
-    xfree(cont->scan_vol_map);
+    ats_free(cont->scan_vol_map);
   memset((char *) &cont->vio, 0, cont->size_to_init);
 #ifdef CACHE_STAT_PAGES
   ink_assert(!cont->stat_link.next && !cont->stat_link.prev);

Modified: trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc Wed Sep  7 21:46:03 2011
@@ -119,11 +119,11 @@ void RamCacheCLFUS::resize_hashtable() {
       while ((e = bucket[i].pop()))
         new_bucket[e->key.word(3) % anbuckets].push(e);
     }
-    xfree(bucket);
+    ats_free(bucket);
   }
   bucket = new_bucket;
   nbuckets = anbuckets;
-  if (seen) xfree(seen);
+  ats_free(seen);
   int size = bucket_sizes[ibuckets] * sizeof(uint16_t);
   seen = (uint16_t*)ats_malloc(size);
   memset(seen, 0, size);
@@ -232,7 +232,7 @@ Lerror:
   CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_misses_stat, 1);
   return 0;
 Lfailed:
-  xfree(b);
+  ats_free(b);
   e = destroy(e);
   DDebug("ram_cache", "get %X %d %d Z_ERR", key->word(3), auxkey1, auxkey2);
   goto Lerror;
@@ -388,14 +388,14 @@ void RamCacheCLFUS::compress_entries(ETh
         e->flag_bits.compressed = cache_config_ram_cache_compress;
         bb = (char*)ats_malloc(l);
         memcpy(bb, b, l);
-        xfree(b);
+        ats_free(b);
         e->compressed_len = l;
         int64_t delta = ((int64_t)l) - (int64_t)e->size;
         bytes += delta;
         CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_bytes_stat, delta);
         e->size = l;
       } else {
-        xfree(b);
+        ats_free(b);
         e->flag_bits.compressed = 0;
         bb = (char*)ats_malloc(e->len);
         memcpy(bb, e->data->data(), e->len);
@@ -411,7 +411,7 @@ void RamCacheCLFUS::compress_entries(ETh
     }
     goto Lcontinue;
   Lfailed:
-    xfree(b);
+    ats_free(b);
     e->flag_bits.incompressible = 1;
   Lcontinue:;
     DDebug("ram_cache", "compress %X %d %d %d %d %d %d %d",

Modified: trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc Wed Sep  7 21:46:03 2011
@@ -78,12 +78,14 @@ void RamCacheLRU::resize_hashtable() {
       while ((e = bucket[i].pop()))
         new_bucket[e->key.word(3) % anbuckets].push(e);
     }
-    xfree(bucket);
+    ats_free(bucket);
   }
   bucket = new_bucket;
   nbuckets = anbuckets;
-  if (seen) xfree(seen);
+  ats_free(seen);
+
   int size = bucket_sizes[ibuckets] * sizeof(uint16_t);
+
   seen = (uint16_t*)ats_malloc(size);
   memset(seen, 0, size);
 }

Modified: trafficserver/traffic/trunk/iocore/cache/Store.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Store.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Store.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Store.cc Wed Sep  7 21:46:03 2011
@@ -187,8 +187,7 @@ Store::delete_all()
     if (disk[i])
       delete disk[i];
   n_disks = 0;
-  if (disk)
-    ::xfree(disk);
+  ats_free(disk);
   disk = NULL;
 }
 
@@ -199,8 +198,7 @@ Store::~Store()
 
 Span::~Span()
 {
-  if (pathname)
-    xfree(pathname);
+  ats_free(pathname);
   if (link.next)
     delete link.next;
 }
@@ -317,10 +315,10 @@ Store::read_config(int fd)
       IOCORE_SignalWarning(REC_SIGNAL_SYSTEM_ERROR, buf);
       Debug("cache_init", "Store::read_config - %s", buf);
       delete ns;
-      xfree(pp);
+      ats_free(pp);
       continue;
     }
-    xfree(pp);
+    ats_free(pp);
     n_dsstore++;
 
     // new Span

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc Wed Sep  7 21:46:03 2011
@@ -2708,7 +2708,7 @@ CacheContinuation::replyLookupEvent(int 
 #endif
       clusterProcessor.invoke_remote(from, CACHE_OP_RESULT_CLUSTER_FUNCTION, msg, len);
 #ifdef PURIFY
-      xfree(msg);
+      ats_free(msg);
 #endif
     }
   } else {

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc Wed Sep  7 21:46:03 2011
@@ -233,20 +233,18 @@ ClusterHandler::~ClusterHandler()
   if (machine)
     free_ClusterMachine(machine);
   machine = NULL;
-  if (hostname)
-    xfree(hostname);
+  ats_free(hostname);
   hostname = NULL;
-  if (channels)
-    xfree(channels);
+  ats_free(channels);
   channels = NULL;
   if (channel_data) {
     for (int i = 0; i < n_channels; ++i) {
       if (channel_data[i]) {
-        xfree(channel_data[i]);
+        ats_free(channel_data[i]);
         channel_data[i] = 0;
       }
     }
-    xfree(channel_data);
+    ats_free(channel_data);
     channel_data = NULL;
   }
   if (read_vcs)

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc Wed Sep  7 21:46:03 2011
@@ -148,7 +148,7 @@ ClusterControl::free_data()
       ink_release_assert(*(((char *) data) - DATA_HDR) == size_index);         
     } else {
       // malloc'ed memory, not alloced via real_alloc_data().
-      // Data will be xfree()'ed when IOBufferBlock is freed
+      // Data will be ats_free()'ed when IOBufferBlock is freed
     }
     iob_block = 0;              // free memory
   }

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterLoadMonitor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterLoadMonitor.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterLoadMonitor.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterLoadMonitor.cc Wed Sep  7 21:46:03 2011
@@ -115,11 +115,11 @@ ClusterLoadMonitor::~ClusterLoadMonitor(
   //
   ink_release_assert(!periodic_action);
   if (ping_response_buckets) {
-    xfree(ping_response_buckets);
+    ats_free(ping_response_buckets);
     ping_response_buckets = 0;
   }
   if (ping_response_history_buf) {
-    xfree(ping_response_history_buf);
+    ats_free(ping_response_history_buf);
     ping_response_history_buf = 0;
   }
 }

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc Wed Sep  7 21:46:03 2011
@@ -145,8 +145,7 @@ clusterHandler(0)
 
 ClusterMachine::~ClusterMachine()
 {
-  if (hostname)
-    xfree(hostname);
+  ats_free(hostname);
 }
 
 #ifndef INK_NO_CLUSTER
@@ -262,7 +261,7 @@ read_MachineList(char *filename, int afd
         Warning("read machine list failure, length mismatch");
         return NULL;
       } else
-        xfree(l);
+        ats_free(l);
       return (MachineList *) xstrdup("number of machines does not match length of list\n");
     }
   }

Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc Wed Sep  7 21:46:03 2011
@@ -71,7 +71,7 @@ ClusterProcessor::internal_invoke_remote
   if (!ch || (!malloced && !((unsigned int) cluster_fn < (uint32_t) SIZE_clusterFunction))) {
     // Invalid message or node is down, free message data
     if (malloced) {
-      xfree(data);
+      ats_free(data);
     }
     if (cmsg) {
       invoke_remote_data_args *args = (invoke_remote_data_args *)

Modified: trafficserver/traffic/trunk/iocore/dns/DNS.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/dns/DNS.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/dns/DNS.cc (original)
+++ trafficserver/traffic/trunk/iocore/dns/DNS.cc Wed Sep  7 21:46:03 2011
@@ -306,7 +306,7 @@ DNSProcessor::dns_init()
 
       ns = (char *) ink_strtok_r(NULL, " ,;\t\r", &last);
     }
-    xfree(ns_list);
+    ats_free(ns_list);
   }
   // The default domain (4th param) and search list (5th param) will
   // come from /etc/resolv.conf.

Modified: trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc (original)
+++ trafficserver/traffic/trunk/iocore/dns/SplitDNS.cc Wed Sep  7 21:46:03 2011
@@ -544,7 +544,7 @@ SplitDNSRecord::Init(matcher_line * line
   }
 
   if (errBuf)
-    xfree(errBuf);
+    ats_free(errBuf);
 
   return NULL;
 }

Modified: trafficserver/traffic/trunk/iocore/eventsystem/P_Freer.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/P_Freer.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/P_Freer.h (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/P_Freer.h Wed Sep  7 21:46:03 2011
@@ -82,14 +82,16 @@ typedef int (FreerContinuation::*FreerCo
 struct FreerContinuation: public Continuation
 {
   void *p;
+
   int dieEvent(int event, Event * e)
   {
     (void) event;
     (void) e;
-    xfree(p);
+    ats_free(p);
     delete this;
-      return EVENT_DONE;
+    return EVENT_DONE;
   }
+
   FreerContinuation(void *ap):Continuation(NULL), p(ap)
   {
     SET_HANDLER((FreerContHandler) & FreerContinuation::dieEvent);

Modified: trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/P_IOBuffer.h Wed Sep  7 21:46:03 2011
@@ -325,7 +325,7 @@ IOBufferData::dealloc()
     if (BUFFER_SIZE_INDEX_IS_FAST_ALLOCATED(_size_index))
       ioBufAllocator[_size_index].free_void(_data);
     else if (BUFFER_SIZE_INDEX_IS_XMALLOCED(_size_index))
-      xfree(_data);
+      ats_free(_data);
     break;
   }
   _data = 0;

Modified: trafficserver/traffic/trunk/iocore/eventsystem/Thread.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/Thread.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/Thread.cc (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/Thread.cc Wed Sep  7 21:46:03 2011
@@ -86,7 +86,7 @@ spawn_thread_internal(void *a)
     p->f(p->a);
   else
     p->me->execute();
-  xfree(a);
+  ats_free(a);
   return NULL;
 }
 

Modified: trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc (original)
+++ trafficserver/traffic/trunk/iocore/eventsystem/UnixEThread.cc Wed Sep  7 21:46:03 2011
@@ -108,7 +108,7 @@ EThread::~EThread()
   if (n_ethreads_to_be_signalled > 0)
     flush_signals(this);
   if (ethreads_to_be_signalled)
-    xfree(ethreads_to_be_signalled);
+    ats_free(ethreads_to_be_signalled);
 }
 
 bool

Modified: trafficserver/traffic/trunk/iocore/hostdb/MultiCache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/hostdb/MultiCache.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/hostdb/MultiCache.cc (original)
+++ trafficserver/traffic/trunk/iocore/hostdb/MultiCache.cc Wed Sep  7 21:46:03 2011
@@ -1253,7 +1253,7 @@ MultiCacheHeapGC(Continuation *acont, Mu
     mc->heap_halfspace = mc->heap_halfspace ? 0 : 1;
   }
   ~MultiCacheHeapGC() {
-    xfree(offset_table);
+    ats_free(offset_table);
   }
 };
 
@@ -1302,8 +1302,7 @@ UnsunkPtrRegistry::UnsunkPtrRegistry()
 
 UnsunkPtrRegistry::~UnsunkPtrRegistry()
 {
-  if (ptrs)
-    xfree(ptrs);
+  ats_free(ptrs);
 }
 
 void

Modified: trafficserver/traffic/trunk/iocore/net/NetVCTest.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/NetVCTest.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/NetVCTest.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/NetVCTest.cc Wed Sep  7 21:46:03 2011
@@ -214,7 +214,7 @@ NetVCTest::fill_buffer(MIOBuffer * buf, 
   }
 
   buf->write(space, to_add);
-  xfree(space);
+  ats_free(space);
 
   return to_add;
 }

Modified: trafficserver/traffic/trunk/iocore/net/P_Socks.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/P_Socks.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/P_Socks.h (original)
+++ trafficserver/traffic/trunk/iocore/net/P_Socks.h Wed Sep  7 21:46:03 2011
@@ -161,7 +161,7 @@ TS_INLINE void
 SocksAddrType::reset()
 {
   if (type != SOCKS_ATYPE_IPV4 && addr.buf) {
-    xfree(addr.buf);
+    ats_free(addr.buf);
   }
 
   addr.buf = 0;

Modified: trafficserver/traffic/trunk/iocore/net/SSLCertLookup.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/SSLCertLookup.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/SSLCertLookup.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/SSLCertLookup.cc Wed Sep  7 21:46:03 2011
@@ -114,9 +114,9 @@ SSLCertLookup::buildTable()
             addInfoToHash(addr, sslCert, priKey);
             ret = 1;
           }
-          xfree(sslCert);
-          xfree(priKey);
-          xfree(addr);
+          ats_free(sslCert);
+          ats_free(priKey);
+          ats_free(addr);
           addr = NULL;
           sslCert = NULL;
           priKey = NULL;
@@ -138,7 +138,7 @@ SSLCertLookup::buildTable()
     Print();
   }
 */
-  xfree(file_buf);
+  ats_free(file_buf);
   return ret;
 }
 

Modified: trafficserver/traffic/trunk/iocore/net/SSLConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/SSLConfig.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/SSLConfig.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/SSLConfig.cc Wed Sep  7 21:46:03 2011
@@ -75,71 +75,71 @@ void
 SslConfigParams::cleanup()
 {
   if (serverCertPath) {
-    xfree(serverCertPath);
+    ats_free(serverCertPath);
     serverCertPath = NULL;
   }
   if (serverCertChainPath) {
-    xfree(serverCertChainPath);
+    ats_free(serverCertChainPath);
     serverCertChainPath = NULL;
   }
   if (serverKeyPath) {
-    xfree(serverKeyPath);
+    ats_free(serverKeyPath);
     serverKeyPath = NULL;
   }
   if (CACertFilename) {
-    xfree(CACertFilename);
+    ats_free(CACertFilename);
     CACertFilename = NULL;
   }
   if (CACertPath) {
-    xfree(CACertPath);
+    ats_free(CACertPath);
     CACertPath = NULL;
   }
   if (clientCertPath) {
-    xfree(clientCertPath);
+    ats_free(clientCertPath);
     clientCertPath = NULL;
   }
   if (clientKeyPath) {
-    xfree(clientKeyPath);
+    ats_free(clientKeyPath);
     clientKeyPath = NULL;
   }
   if (clientCACertFilename) {
-    xfree(clientCACertFilename);
+    ats_free(clientCACertFilename);
     clientCACertFilename = NULL;
   }
   if (clientCACertPath) {
-    xfree(clientCACertPath);
+    ats_free(clientCACertPath);
     clientCACertPath = NULL;
   }
   if (configFilePath) {
-    xfree(configFilePath);
+    ats_free(configFilePath);
     configFilePath = NULL;
   }
   if (serverCertPathOnly) {
-    xfree(serverCertPathOnly);
+    ats_free(serverCertPathOnly);
     serverCertPathOnly = NULL;
   }
   if (serverKeyPathOnly) {
-    xfree(serverKeyPathOnly);
+    ats_free(serverKeyPathOnly);
     serverKeyPathOnly = NULL;
   }
   if (ncipherAccelLibPath) {
-    xfree(ncipherAccelLibPath);
+    ats_free(ncipherAccelLibPath);
     ncipherAccelLibPath = NULL;
   }
   if (cswiftAccelLibPath) {
-    xfree(cswiftAccelLibPath);
+    ats_free(cswiftAccelLibPath);
     cswiftAccelLibPath = NULL;
   }
   if (atallaAccelLibPath) {
-    xfree(atallaAccelLibPath);
+    ats_free(atallaAccelLibPath);
     atallaAccelLibPath = NULL;
   }
   if (broadcomAccelLibPath) {
-    xfree(broadcomAccelLibPath);
+    ats_free(broadcomAccelLibPath);
     broadcomAccelLibPath = NULL;
   }
   if (cipherSuite) {
-    xfree(cipherSuite);
+    ats_free(cipherSuite);
     cipherSuite = NULL;
   }
 
@@ -305,7 +305,7 @@ SslConfigParams::initialize()
       i++;
     }
 #endif
-    xfree(cert_chain);
+    ats_free(cert_chain);
   }
 
   IOCORE_ReadConfigStringAlloc(multicert_config_file, "proxy.config.ssl.server.multicert.filename");
@@ -320,7 +320,7 @@ SslConfigParams::initialize()
       i++;
     }
 #endif
-    xfree(multicert_config_file);
+    ats_free(multicert_config_file);
   }
   // Added Alloc as a temp fix for warnings generated
   // by the ReadConfigString Macro when a string is NULL.
@@ -333,7 +333,7 @@ SslConfigParams::initialize()
 
   if (ssl_server_private_key_path != NULL) {
     serverKeyPathOnly = Layout::get()->relative(ssl_server_private_key_path);
-    xfree(ssl_server_private_key_path);
+    ats_free(ssl_server_private_key_path);
   }
   else {
     // XXX: private_key.filename is relative to prefix or sysconfdir?
@@ -351,14 +351,14 @@ SslConfigParams::initialize()
       i++;
     }
 #endif
-    xfree(ssl_server_private_key_filename);
+    ats_free(ssl_server_private_key_filename);
   }
 
   ssl_server_private_key_path = NULL;
 
   IOCORE_ReadConfigStringAlloc(CACertFilename, "proxy.config.ssl.CA.cert.filename");
   if (CACertFilename && (*CACertFilename == 0)) {
-    xfree(CACertFilename);
+    ats_free(CACertFilename);
     CACertFilename = NULL;
   }
 
@@ -376,8 +376,8 @@ SslConfigParams::initialize()
       i++;
     }
 #endif
-    xfree(abs_path);
-    xfree(CACertRelativePath);
+    ats_free(abs_path);
+    ats_free(CACertRelativePath);
   }
 
   // SSL session cache configurations
@@ -408,10 +408,10 @@ SslConfigParams::initialize()
       i++;
     }
 #endif
-    xfree(abs_path);
-    xfree(ssl_client_cert_filename);
+    ats_free(abs_path);
+    ats_free(ssl_client_cert_filename);
   }
-  xfree(ssl_client_cert_path);
+  ats_free(ssl_client_cert_path);
 
   ssl_client_cert_filename = NULL;
   ssl_client_cert_path = NULL;
@@ -435,17 +435,17 @@ SslConfigParams::initialize()
       i++;
     }
 #endif
-    xfree(abs_path);
-    xfree(ssl_client_private_key_filename);
+    ats_free(abs_path);
+    ats_free(ssl_client_private_key_filename);
   }
-  xfree(ssl_client_private_key_path);
+  ats_free(ssl_client_private_key_path);
 
   ssl_client_private_key_path = NULL;
 
 
   IOCORE_ReadConfigStringAlloc(clientCACertFilename, "proxy.config.ssl.client.CA.cert.filename");
   if (clientCACertFilename && (*clientCACertFilename == 0)) {
-    xfree(clientCACertFilename);
+    ats_free(clientCACertFilename);
     clientCACertFilename = NULL;
   }
 
@@ -464,7 +464,7 @@ SslConfigParams::initialize()
       i++;
     }
 #endif
-    xfree(clientCACertRelativePath);
+    ats_free(clientCACertRelativePath);
   }
 }
 

Modified: trafficserver/traffic/trunk/iocore/net/Socks.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/net/Socks.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/net/Socks.cc (original)
+++ trafficserver/traffic/trunk/iocore/net/Socks.cc Wed Sep  7 21:46:03 2011
@@ -513,7 +513,7 @@ loadSocksConfiguration(socks_conf_struct
 
   Layout::relative_to(config_pathname, sizeof(config_pathname),
                       Layout::get()->sysconfdir, socks_config_file);
-  xfree(socks_config_file);
+  ats_free(socks_config_file);
   Debug("Socks", "Socks Config File: %s", config_pathname);
 
   socks_config_fd =::open(config_pathname, O_RDONLY);
@@ -532,7 +532,7 @@ loadSocksConfiguration(socks_conf_struct
 
   if (tmp) {
     Error("SOCKS Config: Error while reading ip_range: %s.", tmp);
-    xfree(tmp);
+    ats_free(tmp);
     goto error;
   }
 #endif

Modified: trafficserver/traffic/trunk/iocore/utils/Machine.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/utils/Machine.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/utils/Machine.cc (original)
+++ trafficserver/traffic/trunk/iocore/utils/Machine.cc Wed Sep  7 21:46:03 2011
@@ -127,10 +127,7 @@ Machine::Machine(char *ahostname, unsign
 
 Machine::~Machine()
 {
-  if (hostname)
-    xfree(hostname);
-  if (ip_string)
-    xfree(ip_string);
-  if (ip_hex_string)
-    xfree(ip_hex_string);
+  ats_free(hostname);
+  ats_free(ip_string);
+  ats_free(ip_hex_string);
 }

Modified: trafficserver/traffic/trunk/lib/records/I_RecCore.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/I_RecCore.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/I_RecCore.h (original)
+++ trafficserver/traffic/trunk/lib/records/I_RecCore.h Wed Sep  7 21:46:03 2011
@@ -190,7 +190,7 @@ void RecSignalManager(int, const char *)
  */
 #define REC_EstablishStaticConfigStringAlloc(_var, _config_var_name) do { \
   if (RecLinkConfigString(_config_var_name, &_var) == REC_ERR_OKAY) \
-    xfree(_var); \
+    ats_free(_var);                                                    \
   _var = (RecString)REC_ConfigReadString(_config_var_name); \
 } while (0)
 

Modified: trafficserver/traffic/trunk/lib/records/P_RecCore.i
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/P_RecCore.i?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/P_RecCore.i (original)
+++ trafficserver/traffic/trunk/lib/records/P_RecCore.i Wed Sep  7 21:46:03 2011
@@ -571,9 +571,7 @@ RecReadStatsFile()
   }
 
   ink_rwlock_unlock(&g_records_rwlock);
-
-  if (m)
-    xfree(m);
+  ats_free(m);
 
   return REC_ERR_OKAY;
 }
@@ -653,10 +651,8 @@ RecReadConfigFile()
   // clear our g_rec_config_contents_xxx structures
   while (!queue_is_empty(g_rec_config_contents_llq)) {
     cfe = (RecConfigFileEntry *) dequeue(g_rec_config_contents_llq);
-    if (cfe->entry) {
-      xfree(cfe->entry);
-    }
-    xfree(cfe);
+    ats_free(cfe->entry);
+    ats_free(cfe);
   }
   ink_hash_table_destroy(g_rec_config_contents_ht);
   g_rec_config_contents_ht = ink_hash_table_create(InkHashTableKeyType_String);
@@ -772,13 +768,13 @@ RecReadConfigFile()
   L_done:
     line = line_tok.iterNext(&line_tok_state);
     line_num++;
-    xfree(lc);
+    ats_free(lc);
   }
 
   // release our hash table
   ink_rwlock_unlock(&g_records_rwlock);
   ink_mutex_release(&g_rec_config_lock);
-  xfree(fbuf);
+  ats_free(fbuf);
 
   return REC_ERR_OKAY;
 }

Modified: trafficserver/traffic/trunk/lib/records/RecCompatibility.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecCompatibility.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecCompatibility.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecCompatibility.cc Wed Sep  7 21:46:03 2011
@@ -112,7 +112,7 @@ RecFileImport_Xmalloc(const char *file, 
         (*file_buf)[*file_size] = '\0';
         err = REC_ERR_OKAY;
       } else {
-        xfree(*file_buf);
+        ats_free(*file_buf);
         *file_buf = 0;
         *file_size = 0;
       }

Modified: trafficserver/traffic/trunk/lib/records/RecCore.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecCore.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecCore.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecCore.cc Wed Sep  7 21:46:03 2011
@@ -171,10 +171,7 @@ link_string_alloc(const char *name, RecD
 
   RecString _temp2 = data.rec_string;
   data.rec_string = _new_value;
-
-  if (_temp2 != 0) {
-    xfree(_temp2);
-  }
+  ats_free(_temp2);
 
   return REC_ERR_OKAY;
 }
@@ -224,7 +221,7 @@ RecCoreInit(RecModeT mode_type, Diags *_
     bool file_exists = true;
     g_rec_config_fpath = Layout::relative_to(Layout::get()->sysconfdir, REC_CONFIG_FILE REC_SHADOW_EXT);
     if (RecFileExists(g_rec_config_fpath) == REC_ERR_FAIL) {
-      xfree((char *)g_rec_config_fpath);
+      ats_free((char *)g_rec_config_fpath);
       g_rec_config_fpath = Layout::relative_to(Layout::get()->sysconfdir, REC_CONFIG_FILE);
       if (RecFileExists(g_rec_config_fpath) == REC_ERR_FAIL) {
         RecLog(DL_Warning, "Could not find '%s', system will run with defaults\n", REC_CONFIG_FILE);
@@ -658,7 +655,7 @@ RecGetRecordDefaultDataString_Xmalloc(ch
         strncpy(*buf, r->data_default.rec_string, 1023);
         buf[1023] = '\0';
       } else {
-        xfree(*buf);
+        ats_free(*buf);
         *buf = NULL;
       }
       break;
@@ -667,7 +664,7 @@ RecGetRecordDefaultDataString_Xmalloc(ch
       break;
     default:
       ink_debug_assert(!"Unexpected RecD type");
-      xfree(*buf);
+      ats_free(*buf);
       *buf = NULL;
       break;
     }
@@ -765,7 +762,7 @@ RecRegisterConfig(RecT rec_type, const c
     r->config_meta.update_type = update_type;
     r->config_meta.check_type = check_type;
     if (r->config_meta.check_expr) {
-      xfree(r->config_meta.check_expr);
+      ats_free(r->config_meta.check_expr);
     }
     r->config_meta.check_expr = xstrdup(check_expr);
     r->config_meta.update_cb_list = NULL;
@@ -849,9 +846,7 @@ RecForceInsert(RecRecord * record)
     r->config_meta.update_required = record->config_meta.update_required;
     r->config_meta.update_type = record->config_meta.update_type;
     r->config_meta.check_type = record->config_meta.check_type;
-    if (r->config_meta.check_expr) {
-      xfree(r->config_meta.check_expr);
-    }
+    ats_free(r->config_meta.check_expr);
     r->config_meta.check_expr = xstrdup(record->config_meta.check_expr);
     r->config_meta.access_type = record->config_meta.access_type;
   }

Modified: trafficserver/traffic/trunk/lib/records/RecMessage.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecMessage.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecMessage.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecMessage.cc Wed Sep  7 21:46:03 2011
@@ -60,7 +60,7 @@ send_thr(void *data)
     if (RecPipeWrite(h_pipe, (char *) msg_hdr, msg_size) == REC_ERR_FAIL) {
       ink_release_assert("Pipe write failed, message lost");
     }
-    xfree(msg_hdr);
+    ats_free(msg_hdr);
   }
   return NULL;
 }
@@ -119,7 +119,7 @@ recv_cb_thr(void *data)
     if (g_recv_cb) {
       msg = (RecMessage *) dequeue(g_recv_llq);
       RecMessageRecvThis(0, (char *) msg, 0);
-      xfree(msg);
+      ats_free(msg);
     }
   }
   return NULL;
@@ -290,7 +290,7 @@ RecMessageAlloc(RecMessageT msg_type, in
 int
 RecMessageFree(RecMessage * msg)
 {
-  xfree(msg);
+  ats_free(msg);
   return REC_ERR_OKAY;
 }
 
@@ -511,10 +511,8 @@ RecMessageReadFromDisk(const char *fpath
   goto Ldone;
 
 Lerror:
-  if (msg != NULL) {
-    xfree(msg);
-    msg = NULL;
-  }
+  ats_free(msg);
+  msg = NULL;
 
 Ldone:
   if (h_file != REC_HANDLE_INVALID) {

Modified: trafficserver/traffic/trunk/lib/records/RecTree.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecTree.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecTree.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecTree.cc Wed Sep  7 21:46:03 2011
@@ -50,9 +50,7 @@ num_leaf(0)
 
 RecTreeNode::~RecTreeNode()
 {
-  if (node_name) {
-    xfree(node_name);
-  }
+  ats_free(node_name);
 }
 
 /**

Modified: trafficserver/traffic/trunk/lib/records/RecUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/records/RecUtils.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/records/RecUtils.cc (original)
+++ trafficserver/traffic/trunk/lib/records/RecUtils.cc Wed Sep  7 21:46:03 2011
@@ -62,7 +62,7 @@ void
 RecDataClear(RecDataT data_type, RecData * data)
 {
   if ((data_type == RECD_STRING) && (data->rec_string)) {
-    xfree(data->rec_string);
+    ats_free(data->rec_string);
   }
   memset(data, 0, sizeof(RecData));
 }
@@ -80,15 +80,13 @@ RecDataSet(RecDataT data_type, RecData *
   case RECD_STRING:
     if (data_src->rec_string == NULL) {
       if (data_dst->rec_string != NULL) {
-        xfree(data_dst->rec_string);
+        ats_free(data_dst->rec_string);
         data_dst->rec_string = NULL;
         rec_set = true;
       }
     } else if (((data_dst->rec_string) && (strcmp(data_dst->rec_string, data_src->rec_string) != 0)) ||
                ((data_dst->rec_string == NULL) && (data_src->rec_string != NULL))) {
-      if (data_dst->rec_string) {
-        xfree(data_dst->rec_string);
-      }
+      ats_free(data_dst->rec_string);
       data_dst->rec_string = xstrdup(data_src->rec_string);
       rec_set = true;
     }
@@ -135,9 +133,8 @@ RecDataSetFromInk64(RecDataT data_type, 
   case RECD_STRING:
     {
       char buf[32 + 1];
-      if (data_dst->rec_string) {
-        xfree(data_dst->rec_string);
-      }
+
+      ats_free(data_dst->rec_string);
       snprintf(buf, 32, "%" PRId64 "", data_int64);
       data_dst->rec_string = xstrdup(buf);
       break;
@@ -170,9 +167,8 @@ RecDataSetFromFloat(RecDataT data_type, 
   case RECD_STRING:
     {
       char buf[32 + 1];
-      if (data_dst->rec_string) {
-        xfree(data_dst->rec_string);
-      }
+
+      ats_free(data_dst->rec_string);
       snprintf(buf, 32, "%f", data_float);
       data_dst->rec_string = xstrdup(buf);
       break;

Modified: trafficserver/traffic/trunk/lib/ts/Arena.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/Arena.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/Arena.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/Arena.cc Wed Sep  7 21:46:03 2011
@@ -66,7 +66,7 @@ blk_free(ArenaBlock * blk)
   if (size == DEFAULT_BLOCK_SIZE) {
     defaultSizeArenaBlock.free_void(blk);
   } else {
-    xfree(blk);
+    ats_free(blk);
   }
 }
 

Modified: trafficserver/traffic/trunk/lib/ts/Diags.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/Diags.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/Diags.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/Diags.cc Wed Sep  7 21:46:03 2011
@@ -146,8 +146,8 @@ Diags::~Diags()
 {
   diags_log_fp = NULL;
 
-  xfree(base_debug_tags);
-  xfree(base_action_tags);
+  ats_free(base_debug_tags);
+  ats_free(base_action_tags);
 
   deactivate_all(DiagsTagType_Debug);
   deactivate_all(DiagsTagType_Action);

Modified: trafficserver/traffic/trunk/lib/ts/HostLookup.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/HostLookup.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/HostLookup.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/HostLookup.cc Wed Sep  7 21:46:03 2011
@@ -605,7 +605,7 @@ hostArray::~hostArray()
   for (int i = 0; i < num_el; i++) {
     ink_assert(branch_array[i] != NULL);
     ink_assert(match_data[i] != NULL);
-    xfree(match_data[i]);
+    ats_free(match_data[i]);
   }
 }
 
@@ -791,7 +791,7 @@ HostLookup::~HostLookup()
   if (leaf_array != NULL) {
     // Free up the match strings
     for (int i = 0; i < num_el; i++) {
-      xfree(leaf_array[i].match);
+      ats_free(leaf_array[i].match);
     }
     delete[]leaf_array;
   }
@@ -1110,7 +1110,7 @@ HostLookup::TableInsert(const char *matc
   //   HOST_BRANCH
   cur->leaf_indexs(cur->leaf_indexs.length()) = index;
 
-  xfree(match_copy);
+  ats_free(match_copy);
 }
 
 // bool HostLookup::MatchArray(HostLookupState* s, void**opaque_ptr, DynArray<int>& array,

Modified: trafficserver/traffic/trunk/lib/ts/HostLookup.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/HostLookup.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/HostLookup.h (original)
+++ trafficserver/traffic/trunk/lib/ts/HostLookup.h Wed Sep  7 21:46:03 2011
@@ -79,12 +79,14 @@ typedef void (*HostLookupPrintFunc) (voi
 
 struct HostLookupState
 {
-  HostLookupState():cur(NULL), table_level(0), array_index(0), hostname(NULL), host_copy(NULL), host_copy_next(NULL)
-  {
-  };
+  HostLookupState()
+    : cur(NULL), table_level(0), array_index(0), hostname(NULL), host_copy(NULL), host_copy_next(NULL)
+  { }
+
   ~HostLookupState() {
-    xfree(host_copy);
-  };
+    ats_free(host_copy);
+  }
+
   HostBranch *cur;
   int table_level;
   int array_index;

Modified: trafficserver/traffic/trunk/lib/ts/I_Layout.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/I_Layout.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/I_Layout.h (original)
+++ trafficserver/traffic/trunk/lib/ts/I_Layout.h Wed Sep  7 21:46:03 2011
@@ -59,7 +59,7 @@ struct Layout
 
   /**
    Return file path relative to Layout->prefix
-   Memory is allocated, so use xfree() when no longer needed
+   Memory is allocated, so use ats_free() when no longer needed
 
   */
   char *relative(const char *file);
@@ -74,7 +74,7 @@ struct Layout
 
   /**
    Return file path relative to dir
-   Memory is allocated, so use xfree() when no longer needed
+   Memory is allocated, so use ats_free() when no longer needed
    Example usage: Layout::relative_to(default_layout()->sysconfdir, "foo.bar");
 
   */

Modified: trafficserver/traffic/trunk/lib/ts/Layout.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/Layout.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/Layout.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/Layout.cc Wed Sep  7 21:46:03 2011
@@ -214,23 +214,20 @@ Layout::Layout(const char *_prefix)
 
 Layout::~Layout()
 {
-#define SafeFree(x) \
-  if (x) xfree(x);
-
-  SafeFree(prefix);
-  SafeFree(exec_prefix);
-  SafeFree(bindir);
-  SafeFree(sbindir);
-  SafeFree(sysconfdir);
-  SafeFree(datadir);
-  SafeFree(includedir);
-  SafeFree(libdir);
-  SafeFree(libexecdir);
-  SafeFree(localstatedir);
-  SafeFree(runtimedir);
-  SafeFree(logdir);
-  SafeFree(mandir);
-  SafeFree(infodir);
-  SafeFree(cachedir);
+  ats_free(prefix);
+  ats_free(exec_prefix);
+  ats_free(bindir);
+  ats_free(sbindir);
+  ats_free(sysconfdir);
+  ats_free(datadir);
+  ats_free(includedir);
+  ats_free(libdir);
+  ats_free(libexecdir);
+  ats_free(localstatedir);
+  ats_free(runtimedir);
+  ats_free(logdir);
+  ats_free(mandir);
+  ats_free(infodir);
+  ats_free(cachedir);
 }
 

Modified: trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/MatcherUtils.cc Wed Sep  7 21:46:03 2011
@@ -82,7 +82,7 @@ readIntoBuffer(char *file_path, const ch
   // Check to make sure that we got the whole file
   if (read_size < 0) {
     Error("%s Read of %s file failed : %s", module_name, file_path, strerror(errno));
-    xfree(file_buf);
+    ats_free(file_buf);
     file_buf = NULL;
   } else if (read_size < file_info.st_size) {
     // We don't want to signal this error on WIN32 because the sizes

Modified: trafficserver/traffic/trunk/lib/ts/TextBuffer.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/TextBuffer.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/TextBuffer.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/TextBuffer.cc Wed Sep  7 21:46:03 2011
@@ -56,7 +56,7 @@ textBuffer::textBuffer(int size)
 
 textBuffer::~textBuffer()
 {
-  xfree(bufferStart);
+  ats_free(bufferStart);
 }
 
 // void textBuffer::reUse()

Modified: trafficserver/traffic/trunk/lib/ts/Tokenizer.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/Tokenizer.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/Tokenizer.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/Tokenizer.cc Wed Sep  7 21:46:03 2011
@@ -72,16 +72,13 @@ Tokenizer::~Tokenizer()
   while (cur != NULL) {
 
     if (options & COPY_TOKS) {
-      for (int i = 0; i < TOK_NODE_ELEMENTS; i++) {
-        if (cur->el[i] != NULL) {
-          xfree(cur->el[i]);
-        }
-      }
+      for (int i = 0; i < TOK_NODE_ELEMENTS; i++)
+        ats_free(cur->el[i]);
     }
 
     next = cur->next;
     if (root == false) {
-      xfree(cur);
+      ats_free(cur);
     } else {
       root = false;
     }
@@ -356,11 +353,8 @@ Tokenizer::ReUse()
 
   while (cur_node != NULL) {
     if (options & COPY_TOKS) {
-      for (int i = 0; i < TOK_NODE_ELEMENTS; i++) {
-        if (cur_node->el[i] != NULL) {
-          xfree(cur_node->el[i]);
-        }
-      }
+      for (int i = 0; i < TOK_NODE_ELEMENTS; i++)
+        ats_free(cur_node->el[i]);
     }
     memset(cur_node->el, 0, sizeof(char *) * TOK_NODE_ELEMENTS);
     cur_node = cur_node->next;

Modified: trafficserver/traffic/trunk/lib/ts/ink_base64.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_base64.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_base64.h (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_base64.h Wed Sep  7 21:46:03 2011
@@ -37,7 +37,7 @@
  *
  */
 
-// These functions return ats_malloc'd memory which caller needs to xfree
+// These functions return ats_malloc'd memory which caller needs to ats_free
 inkcoreapi char *ink_base64_decode(const char *input, int input_len, int *output_len);
 char *ink_base64_encode(const char *input, int input_len, int *output_len);
 char *ink_base64_encode_unsigned(const unsigned char *input, int input_len, int *output_len);

Modified: trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_hash_table.cc Wed Sep  7 21:46:03 2011
@@ -128,7 +128,7 @@ _ink_hash_table_xfree_entry_value(InkHas
 
   value = ink_hash_table_entry_value(ht_ptr, e);
   if (value != NULL) {
-    xfree(value);
+    ats_free(value);
   }
 
   return (0);

Modified: trafficserver/traffic/trunk/lib/ts/ink_killall.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_killall.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_killall.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_killall.cc Wed Sep  7 21:46:03 2011
@@ -48,13 +48,12 @@ ink_killall(const char *pname, int sig)
   }
 
   if (pidvcnt == 0) {
-    xfree(pidv);
+    ats_free(pidv);
     return 0;
   }
 
   err = ink_killall_kill_pidv(pidv, pidvcnt, sig);
-
-  xfree(pidv);
+  ats_free(pidv);
 
   return err;
 
@@ -99,7 +98,7 @@ ink_killall_get_pidv_xmalloc(const char 
             pid_t *pidv_realloc;
             pidvsize *= 2;
             if (!(pidv_realloc = (pid_t *) xrealloc(*pidv, pidvsize * sizeof(pid_t)))) {
-              xfree(*pidv);
+              ats_free(*pidv);
               goto l_error;
             } else {
               *pidv = pidv_realloc;
@@ -116,7 +115,7 @@ ink_killall_get_pidv_xmalloc(const char 
   closedir(dir);
 
   if (*pidvcnt == 0) {
-    xfree(*pidv);
+    ats_free(*pidv);
     *pidv = 0;
   }
 

Modified: trafficserver/traffic/trunk/lib/ts/ink_memory.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_memory.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_memory.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_memory.cc Wed Sep  7 21:46:03 2011
@@ -160,6 +160,4 @@ ats_free(void *ptr)
 {
   if (likely(ptr != NULL))
     free(ptr);
-  else
-    ink_warning("ats_free: freeing a NULL pointer");
 }                               /* End ats_free */

Modified: trafficserver/traffic/trunk/lib/ts/ink_resource.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_resource.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_resource.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_resource.cc Wed Sep  7 21:46:03 2011
@@ -33,13 +33,6 @@ volatile int res_track_memory = RES_TRAC
 
 /*-------------------------------------------------------------------------
 -------------------------------------------------------------------------*/
-void
-_xfree(void *mem)
-{
-  if (likely(mem))
-    ats_free(mem);
-}
-
 void *
 _xfree_null(void *mem)
 {

Modified: trafficserver/traffic/trunk/lib/ts/ink_resource.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_resource.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_resource.h (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_resource.h Wed Sep  7 21:46:03 2011
@@ -54,12 +54,7 @@ struct Resource
 #define RES_TRACK_MEMORY_DEFAULT 0      /* default value for res_track_memory variable */
 
 #ifdef __cplusplus
-static inline void
-xfree(void *mem)
-{
-  if (mem)
-    ats_free(mem);
-}
+
 static inline void *
 xfree_null(void *mem)
 {
@@ -75,7 +70,6 @@ xfree_null(void *mem)
 
 void *_xrealloc(void *ptr, unsigned int size, const char *path);
 char *_xstrdup(const char *str, int length, const char *path);
-void _xfree(void *ptr);
 void *_xfree_null(void *ptr);
 
 void xdump(void);
@@ -112,13 +106,13 @@ public:
   /// Destructor - free memory held by this instance.
   ~xptr()
   {
-    xfree(m_ptr);
+    ats_free(m_ptr);
   }
 
   /// Assign memory.
   /// @note @a ptr must be allocated via @c ats_malloc.
   self& operator = (T* ptr) {
-    xfree(m_ptr);
+    ats_free(m_ptr);
     m_ptr = ptr;
     return *this;
   }

Modified: trafficserver/traffic/trunk/lib/ts/ink_string++.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_string%2B%2B.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_string++.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_string++.cc Wed Sep  7 21:46:03 2011
@@ -147,7 +147,7 @@ StrListOverflow::clean()
 
   while (current_free) {
     next_free = current_free->next;
-    xfree(current_free);
+    ats_free(current_free);
     current_free = next_free;
   }
 }

Modified: trafficserver/traffic/trunk/lib/ts/ink_string.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/ink_string.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/ink_string.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/ink_string.cc Wed Sep  7 21:46:03 2011
@@ -36,7 +36,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-
 #define INK_MAX_STRING_ARRAY_SIZE 128
 
 /*---------------------------------------------------------------------------*
@@ -269,7 +268,7 @@ ink_string_mpath(int nstrings, ...)
     if ((slash == nstrings - 1) && f[slash]) {
       for (i = 0; i < nstrings - 1; i++) {
         if (f[i])
-          xfree(e[i]);
+          ats_free(e[i]);
       }
       va_end(ap);
       return e[slash];
@@ -284,8 +283,9 @@ ink_string_mpath(int nstrings, ...)
       ink_strncpy(p, e[nstrings - 1], (nsSize - (p - ns)));
     }
     for (i = 0; i < nstrings; i++) {
+      // TODO: This seems horribly wrong...
       if (f[i])
-        xfree(e[i]);
+        ats_free(e[i]);
     }
     va_end(ap);
   }
@@ -360,7 +360,7 @@ ink_string_mjoin(int nstrings, ...)
     ink_strncpy(p, e[nstrings - 1], (nsSize - (p - ns)));
     for (i = 0; i < nstrings; i++) {
       if (f[i])
-        xfree(e[i]);
+        ats_free(e[i]);
     }
     va_end(ap);
   }

Modified: trafficserver/traffic/trunk/lib/ts/llqueue.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/llqueue.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/llqueue.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/llqueue.cc Wed Sep  7 21:46:03 2011
@@ -106,9 +106,7 @@ delete_queue(LLQ * Q)
   // actually empty ...
   //
   //    LLQrec * qrec;
-  if (Q) {
-    xfree(Q);
-  }
+  ats_free(Q);
   return;
 }
 
@@ -227,7 +225,7 @@ dequeue(LLQ * Q)
 
   d = rec->data;
 //freerec(Q, rec);
-  xfree(rec);
+  ats_free(rec);
 
   Q->len--;
   ink_mutex_release(&(Q->mux));

Modified: trafficserver/traffic/trunk/lib/ts/lockfile.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/lib/ts/lockfile.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/lib/ts/lockfile.cc (original)
+++ trafficserver/traffic/trunk/lib/ts/lockfile.cc Wed Sep  7 21:46:03 2011
@@ -236,9 +236,7 @@ lockfile_kill_internal(pid_t init_pid, i
     }
   } while ((err == 0) || ((err < 0) && (errno == EINTR)));
 
-  if (pidv) {
-    xfree(pidv);
-  }
+  ats_free(pidv);
 
 #else
 

Modified: trafficserver/traffic/trunk/mgmt/Alarms.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/Alarms.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/Alarms.cc (original)
+++ trafficserver/traffic/trunk/mgmt/Alarms.cc Wed Sep  7 21:46:03 2011
@@ -159,10 +159,8 @@ Alarms::resolveAlarm(alarm_t a, char *ip
 
   if (!ip && ink_hash_table_lookup(local_alarms, buf, &hash_value) != 0) {
     ink_hash_table_delete(local_alarms, buf);
-    if (((Alarm *) hash_value)->description) {
-      xfree(((Alarm *) hash_value)->description);
-    }
-    xfree(hash_value);
+    ats_free(((Alarm *)hash_value)->description);
+    ats_free(hash_value);
   } else if (ip && ink_hash_table_lookup(remote_alarms, buf, &hash_value) != 0) {
     char buf2[1024];
 
@@ -172,7 +170,7 @@ Alarms::resolveAlarm(alarm_t a, char *ip
       return;
     }
     ink_hash_table_delete(remote_alarms, buf);
-    xfree(hash_value);
+    ats_free(hash_value);
   }
   ink_mutex_release(&mutex);
 
@@ -353,8 +351,7 @@ ALARM_REPEAT:
   ink_assert(new_desc = (char *) alloca(new_desc_size));
   snprintf(new_desc, new_desc_size, "[%s] %s", my_ctime_str, desc);
   desc = new_desc;
-  if (atmp->description)
-    xfree(atmp->description);
+  ats_free(atmp->description);
   const size_t atmp_desc_size = sizeof(char) * (strlen(desc) + 1);
   atmp->description = (char *)ats_malloc(atmp_desc_size);
   ink_strncpy(atmp->description, desc, atmp_desc_size);
@@ -471,8 +468,8 @@ Alarms::clearUnSeen(char *ip)
     if (strstr(key, ip)) {      /* Make sure alarm is for correct ip */
       if (!tmp->seen) {         /* Make sure we did not see it in peer's report */
         ink_hash_table_delete(remote_alarms, key);      /* Safe in iterator? */
-        xfree(tmp->description);
-        xfree(tmp);
+        ats_free(tmp->description);
+        ats_free(tmp);
       }
     }
   }
@@ -669,13 +666,9 @@ Alarms::execAlarmBin(const char *desc)
 #endif // !_WIN32
 
   // free memory
-  if (alarm_email_from_name)
-    xfree(alarm_email_from_name);
-  if (alarm_email_from_addr)
-    xfree(alarm_email_from_addr);
-  if (alarm_email_to_addr)
-    xfree(alarm_email_to_addr);
-
+  ats_free(alarm_email_from_name);
+  ats_free(alarm_email_from_addr);
+  ats_free(alarm_email_to_addr);
 }
 
 //

Modified: trafficserver/traffic/trunk/mgmt/BaseManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/BaseManager.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/BaseManager.cc (original)
+++ trafficserver/traffic/trunk/mgmt/BaseManager.cc Wed Sep  7 21:46:03 2011
@@ -53,9 +53,9 @@ BaseManager::~BaseManager()
 
   while (!queue_is_empty(mgmt_event_queue)) {
     MgmtMessageHdr *mh = (MgmtMessageHdr *) dequeue(mgmt_event_queue);
-    xfree(mh);
+    ats_free(mh);
   }
-  xfree(mgmt_event_queue);
+  ats_free(mgmt_event_queue);
 
   for (entry = ink_hash_table_iterator_first(mgmt_callback_table,
                                              &iterator_state);
@@ -63,12 +63,10 @@ BaseManager::~BaseManager()
     MgmtCallbackList *tmp, *cb_list = (MgmtCallbackList *) entry;
 
     for (tmp = cb_list->next; tmp; tmp = cb_list->next) {
-      xfree(cb_list);
+      ats_free(cb_list);
       cb_list = tmp;
     }
-    if (cb_list) {
-      xfree(cb_list);
-    }
+    ats_free(cb_list);
   }
 
   return;

Modified: trafficserver/traffic/trunk/mgmt/FileManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/FileManager.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/FileManager.cc (original)
+++ trafficserver/traffic/trunk/mgmt/FileManager.cc Wed Sep  7 21:46:03 2011
@@ -251,7 +251,7 @@ FileManager::fileChanged(const char *bas
     //  defensive incase it modified when it is not supposed to be
     filenameCopy = xstrdup(baseFileName);
     (*cb->func) (filenameCopy);
-    xfree(filenameCopy);
+    ats_free(filenameCopy);
   }
   ink_mutex_release(&cbListLock);
 }
@@ -492,7 +492,7 @@ FileManager::removeSnap(const char *snap
     delete[]snapFilePath;
   }
 
-  xfree(dirEntrySpace);
+  ats_free(dirEntrySpace);
   closedir(dir);
 #else
   // Append '\*' as a wildcard for FindFirstFile()

Modified: trafficserver/traffic/trunk/mgmt/LocalManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/LocalManager.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/LocalManager.cc (original)
+++ trafficserver/traffic/trunk/mgmt/LocalManager.cc Wed Sep  7 21:46:03 2011
@@ -163,7 +163,7 @@ LocalManager::clearStats()
         mgmt_log(stderr, "[LocalManager::clearStats] Unlink of %s failed : %s\n", REC_RAW_STATS_FILE, strerror(errno));
       }
     }
-    xfree(statsPath);
+    ats_free(statsPath);
   }
 }
 
@@ -253,7 +253,7 @@ LocalManager::LocalManager(char *mpath, 
       char *main_server_port_attributes = (char *) REC_readString("proxy.config.http.server_port_attr", &found);
       ink_strncpy((char *) proxy_server_port_attributes[pnum],
                   main_server_port_attributes, sizeof(proxy_server_port_attributes[pnum]));
-      xfree(main_server_port_attributes);
+      ats_free(main_server_port_attributes);
       pnum++;
     }
   }
@@ -301,7 +301,7 @@ LocalManager::LocalManager(char *mpath, 
       Debug("lm", "[LocalManager::LocalManager] Unable to listen on all other ports,"
             " max number of other ports exceeded(max == %d)\n", MAX_PROXY_SERVER_PORTS);
     }
-    xfree(proxy_server_other_ports);
+    ats_free(proxy_server_other_ports);
   }
   // Bind proxy ports to incoming_ip_to_bind
   char *incoming_ip_to_bind_str = REC_readString("proxy.local.incoming_ip_to_bind", &found);
@@ -312,7 +312,7 @@ LocalManager::LocalManager(char *mpath, 
   }
   config_path = REC_readString("proxy.config.config_dir", &found);
   char *absolute_config_path = Layout::get()->relative(config_path);
-  xfree(config_path);
+  ats_free(config_path);
   if (access(absolute_config_path, R_OK) == -1) {
     config_path = xstrdup(system_config_directory);
     if (access(config_path, R_OK) == -1) {
@@ -358,14 +358,14 @@ LocalManager::LocalManager(char *mpath, 
   env_prep = REC_readString("proxy.config.env_prep", &found);
   // Calculate configured bin_path from the prefix
   char *absolute_bin_path = Layout::get()->relative(bin_path);
-  xfree(bin_path);
+  ats_free(bin_path);
   bin_path = absolute_bin_path;
   // Calculate proxy_binary from the absolute bin_path
   absolute_proxy_binary = Layout::relative_to(absolute_bin_path, proxy_binary);
 
   if (access(absolute_proxy_binary, R_OK | X_OK) == -1) {
     // Try 'Layout::bindir' directory
-    xfree(absolute_proxy_binary);
+    ats_free(absolute_proxy_binary);
     absolute_proxy_binary = Layout::relative_to(Layout::get()->bindir, proxy_binary);
     // coverity[fs_check_call]
     if (access(absolute_proxy_binary, R_OK | X_OK) == -1) {
@@ -446,10 +446,8 @@ LocalManager::initCCom(int port, char *a
   virt_map = new VMap(intrName, cluster_addr.s_addr, &lmgmt->ccom->mutex);
   virt_map->downAddrs();        // Just to be safe
   ccom->establishChannels();
+  ats_free(intrName);
 
-  if (intrName) {
-    xfree(intrName);
-  }
   return;
 }
 
@@ -874,7 +872,7 @@ LocalManager::sendMgmtMsgToProcesses(Mgm
                 "Invalid 'data_raw' for MGMT_EVENT_CONFIG_FILE_UPDATE\n");
       ink_assert(false);
     }
-    xfree(fname);
+    ats_free(fname);
     break;
   }
 
@@ -1007,8 +1005,7 @@ LocalManager::processEventQueue()
       Debug("lm", "[TrafficManager] ==> Sending signal event '%d'\n", mh->msg_id);
       lmgmt->sendMgmtMsgToProcesses(mh);
     }
-
-    xfree(mh);
+    ats_free(mh);
   }
 }
 

Modified: trafficserver/traffic/trunk/mgmt/LocalManager.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/LocalManager.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/LocalManager.h (original)
+++ trafficserver/traffic/trunk/mgmt/LocalManager.h Wed Sep  7 21:46:03 2011
@@ -58,29 +58,13 @@ public:
     delete alarm_keeper;
     delete virt_map;
     delete ccom;
-    if (config_path)
-    {
-      xfree(config_path);
-    }
-    if (bin_path)
-    {
-      xfree(bin_path);
-    }
-    if (absolute_proxy_binary) {
-      xfree(absolute_proxy_binary);
-    }
-    if (proxy_name) {
-      xfree(proxy_name);
-    }
-    if (proxy_binary) {
-      xfree(proxy_binary);
-    }
-    if (proxy_options) {
-      xfree(proxy_options);
-    }
-    if (env_prep) {
-      xfree(env_prep);
-    }
+    ats_free(config_path);
+    ats_free(bin_path);
+    ats_free(absolute_proxy_binary);
+    ats_free(proxy_name);
+    ats_free(proxy_binary);
+    ats_free(proxy_options);
+    ats_free(env_prep);
   };
 
   void initAlarm();

Modified: trafficserver/traffic/trunk/mgmt/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/Main.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/Main.cc (original)
+++ trafficserver/traffic/trunk/mgmt/Main.cc Wed Sep  7 21:46:03 2011
@@ -675,7 +675,7 @@ main(int argc, char **argv)
       facility_int = LOG_DAEMON;
     } else {
       facility_int = facility_string_to_int(facility_str);
-      xfree(facility_str);
+      ats_free(facility_str);
       if (facility_int < 0) {
         mgmt_elog("Bad syslog facility specified.  Defaulting to DAEMON\n");
         facility_int = LOG_DAEMON;
@@ -718,9 +718,7 @@ main(int argc, char **argv)
 
   /* Update cmd line overrides/environmental overrides/etc */
   if (tsArgs) {                 /* Passed command line args for proxy */
-    if (lmgmt->proxy_options) {
-      xfree(lmgmt->proxy_options);
-    }
+    ats_free(lmgmt->proxy_options);
     lmgmt->proxy_options = tsArgs;
     mgmt_log(stderr, "[main] Traffic Server Args: '%s'\n", lmgmt->proxy_options);
   }

Modified: trafficserver/traffic/trunk/mgmt/MultiFile.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/MultiFile.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/MultiFile.cc (original)
+++ trafficserver/traffic/trunk/mgmt/MultiFile.cc Wed Sep  7 21:46:03 2011
@@ -148,7 +148,7 @@ MultiFile::WalkFiles(ExpandingArray * fi
     delete[]filePath;
   }
 
-  xfree(dirEntry);
+  ats_free(dirEntry);
   closedir(dir);
 #else
   // Append '\*' as a wildcard for FindFirstFile()

Modified: trafficserver/traffic/trunk/mgmt/ProcessManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/ProcessManager.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/ProcessManager.cc (original)
+++ trafficserver/traffic/trunk/mgmt/ProcessManager.cc Wed Sep  7 21:46:03 2011
@@ -149,7 +149,7 @@ ProcessManager::processEventQueue()
       mgmt_log(stderr, "[ProcessManager::processEventQueue] Shutdown msg received, exiting\n");
       _exit(0);
     }                           /* Exit on shutdown */
-    xfree(mh);
+    ats_free(mh);
     ret = true;
   }
   return ret;
@@ -177,7 +177,7 @@ ProcessManager::processSignalQueue()
       mgmt_fatal(stderr, "[ProcessManager::processSignalQueue] Error writing message!");
       //ink_assert(enqueue(mgmt_signal_queue, mh));
     } else {
-      xfree(mh);
+      ats_free(mh);
       ret = true;
     }
   }

Modified: trafficserver/traffic/trunk/mgmt/ProcessManager.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/ProcessManager.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/ProcessManager.h (original)
+++ trafficserver/traffic/trunk/mgmt/ProcessManager.h Wed Sep  7 21:46:03 2011
@@ -58,15 +58,15 @@ public:
     while (!queue_is_empty(mgmt_signal_queue))
     {
       char *sig = (char *) dequeue(mgmt_signal_queue);
-        xfree(sig);
+      ats_free(sig);
     }
-    xfree(mgmt_signal_queue);
-  };
+    ats_free(mgmt_signal_queue);
+  }
 
   void start()
   {
     ink_thread_create(startProcessManager, 0);
-  };
+  }
 
   void stop()
   {
@@ -76,7 +76,7 @@ public:
 #else
     CloseHandle(local_manager_hpipe);
 #endif
-  };
+  }
 
   inkcoreapi void signalManager(int msg_id, const char *data_str);
   inkcoreapi void signalManager(int msg_id, const char *data_raw, int data_len);

Modified: trafficserver/traffic/trunk/mgmt/Rollback.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/Rollback.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/Rollback.cc (original)
+++ trafficserver/traffic/trunk/mgmt/Rollback.cc Wed Sep  7 21:46:03 2011
@@ -166,7 +166,7 @@ root_access_needed(root_access_needed_)
           snprintf(alarmMsg, 2048, "Created zero length place holder for config file %s", fileName);
           mgmt_log(stderr, "[RollBack::Rollback] %s\n", alarmMsg);
           lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_CONFIG_UPDATE_FAILED, alarmMsg);
-          xfree(alarmMsg);
+          ats_free(alarmMsg);
           closeFile(fd);
         } else {
           mgmt_fatal(stderr,
@@ -240,7 +240,7 @@ root_access_needed(root_access_needed_)
       lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_CONFIG_UPDATE_FAILED, alarmMsg);
       closeFile(testFD);
     }
-    xfree(alarmMsg);
+    ats_free(alarmMsg);
   } else {
     closeFile(testFD);
   }
@@ -622,7 +622,7 @@ UPDATE_CLEANUP:
     alarmMsg = (char *)ats_malloc(1024);
     snprintf(alarmMsg, 1024, "[TrafficManager] Configuration File Update Failed: %s", strerror(errno));
     lmgmt->alarm_keeper->signalAlarm(MGMT_ALARM_CONFIG_UPDATE_FAILED, alarmMsg);
-    xfree(alarmMsg);
+    ats_free(alarmMsg);
 
     // Remove both the link from currentVersion_local
     // to the active version and the new version
@@ -828,7 +828,7 @@ Rollback::findVersions_ml(ExpandingArray
 
   }
 
-  xfree(dirEntrySpace);
+  ats_free(dirEntrySpace);
   closedir(dir);
 
 #else

Modified: trafficserver/traffic/trunk/mgmt/Rollback.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/Rollback.h?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/Rollback.h (original)
+++ trafficserver/traffic/trunk/mgmt/Rollback.h Wed Sep  7 21:46:03 2011
@@ -111,7 +111,7 @@ struct versionInfo
 //  findVersions(ExpandingArray* listNames) - scans the config directory for
 //    all versions of the file.  If listNames is not NULL, pointers to versionInfo
 //    structures are inserted into it.  If is the callee's responsibility
-//    to xfree the versionInfo structures.  They are allocated by ats_malloc
+//    to ats_free the versionInfo structures.  They are allocated by ats_malloc
 //
 // private functions
 //

Modified: trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc?rev=1166422&r1=1166421&r2=1166422&view=diff
==============================================================================
--- trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc (original)
+++ trafficserver/traffic/trunk/mgmt/api/CfgContextImpl.cc Wed Sep  7 21:46:03 2011
@@ -148,7 +148,7 @@ CacheObj::formatEleToRule()
     return NULL;
   }
   strncat(buf, pd_str, sizeof(buf) - strlen(buf) - 1);
-  xfree(pd_str);
+  ats_free(pd_str);
 
   switch (m_ele->cfg_ele.type) {
   case TS_CACHE_NEVER:
@@ -171,7 +171,7 @@ CacheObj::formatEleToRule()
     time_str = hms_time_to_string(m_ele->time_period);
     if (time_str) {
       strncat(buf, time_str, sizeof(buf) - strlen(buf) - 1);
-      xfree(time_str);
+      ats_free(time_str);
     }
     strncat(buf, " ", sizeof(buf) - strlen(buf) - 1);
     break;
@@ -180,7 +180,7 @@ CacheObj::formatEleToRule()
     time_str = hms_time_to_string(m_ele->time_period);
     if (time_str) {
       strncat(buf, time_str, sizeof(buf) - strlen(buf) - 1);
-      xfree(time_str);
+      ats_free(time_str);
     }
     strncat(buf, " ", sizeof(buf) - strlen(buf) - 1);
     break;
@@ -189,7 +189,7 @@ CacheObj::formatEleToRule()
     time_str = hms_time_to_string(m_ele->time_period);
     if (time_str) {
       strncat(buf, time_str, sizeof(buf) - strlen(buf) - 1);
-      xfree(time_str);
+      ats_free(time_str);
     }
     strncat(buf, " ", sizeof(buf) - strlen(buf) - 1);
     break;
@@ -229,8 +229,7 @@ bool CacheObj::isValid()
     if (!timeStr) {
       m_valid = false;
     }
-    if (timeStr)
-      xfree(timeStr);
+    ats_free(timeStr);
   default:
     // Handled here:
     // Lots of cases ...
@@ -565,7 +564,7 @@ HostingObj::formatEleToRule()
   strncat(buf, m_ele->pd_val, sizeof(buf) - strlen(buf) - 1);
   strncat(buf, " volume=", sizeof(buf) - strlen(buf) - 1);
   strncat(buf, list_str, sizeof(buf) - strlen(buf) - 1);
-  xfree(list_str);
+  ats_free(list_str);
 
   return xstrdup(buf);
 }
@@ -798,10 +797,9 @@ IcpObj::formatEleToRule()
     break;
   }
 
-  if (ip_str1)
-    xfree(ip_str1);
-  if (ip_str2)
-    xfree(ip_str2);
+  ats_free(ip_str1);
+  ats_free(ip_str2);
+
   return xstrdup(buf);
 }
 
@@ -934,7 +932,7 @@ IpAllowObj::formatEleToRule()
     char *ip_str = ip_addr_ele_to_string(m_ele->src_ip_addr);
     if (ip_str) {
       strncat(buf, ip_str, sizeof(buf) - strlen(buf) - 1);
-      xfree(ip_str);
+      ats_free(ip_str);
     }
   }
 
@@ -1102,7 +1100,7 @@ ParentProxyObj::formatEleToRule()
   if (!pd_str)
     return NULL;
   strncat(buf, pd_str, sizeof(buf) - strlen(buf) - 1);
-  xfree(pd_str);
+  ats_free(pd_str);
 
   // round_robin
   if ((m_ele->rr != TS_RR_NONE) && (m_ele->rr != TS_RR_UNDEFINED)) {
@@ -1136,7 +1134,7 @@ ParentProxyObj::formatEleToRule()
     strncat(buf, "parent=\"", sizeof(buf) - strlen(buf) - 1);
     if (list_str) {
       strncat(buf, list_str, sizeof(buf) - strlen(buf) - 1);
-      xfree(list_str);
+      ats_free(list_str);
     }
     strncat(buf, "\"", sizeof(buf) - strlen(buf) - 1);
 
@@ -1399,7 +1397,7 @@ PluginObj::formatEleToRule()
   list_str = string_list_to_string(m_ele->args, " ");
   if (list_str) {
     snprintf(buf, sizeof(buf), "%s %s", m_ele->name, list_str);
-    xfree(list_str);
+    ats_free(list_str);
   } else {
     snprintf(buf, sizeof(buf), "%s", m_ele->name);
   }
@@ -1513,7 +1511,7 @@ RemapObj::RemapObj(TokenList * tokens)
     if ((token->name)[strlen(token->name) - 1] == '/') {
       memset(buf, 0, MAX_RULE_SIZE);
       ink_strncpy(buf, m_ele->from_host, sizeof(buf));
-      xfree(m_ele->from_host);
+      ats_free(m_ele->from_host);
       strncat(buf, "/", sizeof(buf) - strlen(buf) - 1);
       m_ele->from_host = xstrdup(buf);
     }
@@ -1570,7 +1568,7 @@ RemapObj::RemapObj(TokenList * tokens)
 
       memset(buf, 0, MAX_RULE_SIZE);
       ink_strncpy(buf, m_ele->to_host, sizeof(buf));
-      xfree(m_ele->to_host);
+      ats_free(m_ele->to_host);
       strncat(buf, "/", sizeof(buf) - strlen(buf) - 1);
       m_ele->to_host = xstrdup(buf);
 
@@ -1858,7 +1856,7 @@ SocksObj::formatEleToRule()
     char *str_list = ip_addr_list_to_string((LLQ *) m_ele->ip_addrs, ",");
     if (str_list) {
       snprintf(buf, sizeof(buf), "no_socks %s", str_list);
-      xfree(str_list);
+      ats_free(str_list);
     } else {
       return NULL;              // invalid ip_addr_list
     }
@@ -1870,7 +1868,7 @@ SocksObj::formatEleToRule()
     if (ip_str) {
       strncat(buf, "dest_ip=", sizeof(buf) - strlen(buf) - 1);
       strncat(buf, ip_str, sizeof(buf) - strlen(buf) - 1);
-      xfree(ip_str);
+      ats_free(ip_str);
     } else {
       return NULL;              // invalid IP
     }
@@ -1886,7 +1884,7 @@ SocksObj::formatEleToRule()
         strncat(buf, "parent=\"", sizeof(buf) - strlen(buf) - 1);
         strncat(buf, list_str, sizeof(buf) - strlen(buf) - 1);
         strncat(buf, "\"", sizeof(buf) - strlen(buf) - 1);
-        xfree(list_str);
+        ats_free(list_str);
       } else {
         return NULL;            // invalid list
       }
@@ -2108,7 +2106,7 @@ SplitDnsObj::formatEleToRule()
       if (strstr(temp, " ")) {
         strncat(buf, "\"", sizeof(buf) - strlen(buf) - 1);
       }
-      xfree(temp);
+      ats_free(temp);
     }
     strncat(buf, " ", sizeof(buf) - strlen(buf) - 1);
   }
@@ -2136,7 +2134,7 @@ SplitDnsObj::formatEleToRule()
       if (strstr(temp, " ")) {
         strncat(buf, "\"", sizeof(buf) - strlen(buf) - 1);
       }
-      xfree(temp);
+      ats_free(temp);
     }
     strncat(buf, " ", sizeof(buf) - strlen(buf) - 1);
   }
@@ -2145,8 +2143,7 @@ SplitDnsObj::formatEleToRule()
     buf[strlen(buf) - 1] = '\0';
   }
 
-  if (pd_name)
-    xfree(pd_name);
+  ats_free(pd_name);
 
   return xstrdup(buf);
 }
@@ -2367,7 +2364,7 @@ UpdateObj::formatEleToRule()
   if (list_str) {
     snprintf(buf, sizeof(buf), "%s\\%s\\%d\\%d\\%d\\",
              m_ele->url, list_str, m_ele->offset_hour, m_ele->interval, m_ele->recursion_depth);
-    xfree(list_str);
+    ats_free(list_str);
   } else {
     snprintf(buf, sizeof(buf), "%s\\\\%d\\%d\\%d\\",
              m_ele->url, m_ele->offset_hour, m_ele->interval, m_ele->recursion_depth);
@@ -2393,7 +2390,7 @@ bool UpdateObj::isValid()
   if (list_str) {
     if (strstr(list_str, "\\"))
       m_valid = false;
-    xfree(list_str);
+    ats_free(list_str);
   }
   // offset hour range is 00-23
   if (m_ele->offset_hour < 0 || m_ele->offset_hour > 23)
@@ -2497,8 +2494,7 @@ VirtIpAddrObj::formatEleToRule()
 
   ip_str = ip_addr_to_string(m_ele->ip_addr);
   snprintf(buf, sizeof(buf), "%s %s %d", ip_str, m_ele->intr, m_ele->sub_intr);
-  if (ip_str)
-    xfree(ip_str);
+  ats_free(ip_str);
 
   return xstrdup(buf);
 }



Mime
View raw message