diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-06-18 14:50:38 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-06-18 14:50:38 +0000 |
commit | fffa3b37ffc1bc214339572ec752e791f6ff635b (patch) | |
tree | 29be01adaff19b81e7eae9076024e0fc6e28b1f3 /ace/ACE.cpp | |
parent | e19798e0586110df5e10a70c51f139c64d2821e3 (diff) | |
download | ATCD-fffa3b37ffc1bc214339572ec752e791f6ff635b.tar.gz |
(get_ip_interfaces): use auto_array_ptr instead of auto_ptr so that the array gets deleted properly, and zero it out to avoid unitialized memory read reports from Purify
Diffstat (limited to 'ace/ACE.cpp')
-rw-r--r-- | ace/ACE.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 31dbd09dc21..a51d3faf85f 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -1835,7 +1835,11 @@ ACE::get_ip_interfaces (size_t &count, // ioctl likes to have an extra ifreq structure to mark the end of what it // returned, so increase the num_ifs by one. ++num_ifs; - auto_ptr<struct ifreq> p_ifs (new struct ifreq[num_ifs]); + + struct ifreq *ifs; + ACE_NEW_RETURN (ifs, struct ifreq[num_ifs], -1); + ACE_OS::memset (ifs, 0, num_ifs * sizeof (struct ifreq)); + auto_array_ptr<struct ifreq> p_ifs (ifs); if (p_ifs.get() == 0) { @@ -1883,5 +1887,5 @@ ACE::get_ip_interfaces (size_t &count, } #if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) -template class auto_ptr<struct ifreq>; +template class auto_array_ptr<struct ifreq>; #endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ |