This is an automated email from the ASF dual-hosted git repository.

scw00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new c2a9189  Frees disk_vols when volume create failed
c2a9189 is described below

commit c2a91894585bd84ec14ae367762dcadb55e0f645
Author: scw00 <sc...@apache.org>
AuthorDate: Mon Feb 18 16:55:54 2019 +0800

    Frees disk_vols when volume create failed
---
 iocore/cache/Cache.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 4933727..e1416fa 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -2865,6 +2865,8 @@ cplist_reconfigure()
         new_cp->disk_vols = (DiskVol **)ats_malloc(gndisks * sizeof(DiskVol 
*));
         memset(new_cp->disk_vols, 0, gndisks * sizeof(DiskVol *));
         if (create_volume(config_vol->number, size_in_blocks, 
config_vol->scheme, new_cp)) {
+          ats_free(new_cp->disk_vols);
+          new_cp->disk_vols = nullptr;
           delete new_cp;
           return -1;
         }

Reply via email to