From 45255810365be789c8060374f371e55b9c264c73 Mon Sep 17 00:00:00 2001 From: Philip Liard Date: Thu, 24 Mar 2011 09:15:50 +0000 Subject: [PATCH] Cpp:Fix a small memory leak. --- cpp/src/phonenumberutil.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/src/phonenumberutil.cc b/cpp/src/phonenumberutil.cc index 70816f7b7..bb1d5121e 100644 --- a/cpp/src/phonenumberutil.cc +++ b/cpp/src/phonenumberutil.cc @@ -737,6 +737,12 @@ PhoneNumberUtil::PhoneNumberUtil(MetadataProvider* provider) } PhoneNumberUtil::~PhoneNumberUtil() { + for (vector::const_iterator it = + country_code_to_region_code_map_->begin(); + it != country_code_to_region_code_map_->end(); + ++it) { + delete it->second; + } } // Public wrapper function to get a PhoneNumberUtil instance with the default