Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: net/ftp/ftp_directory_listing_buffer.cc

Issue 355037: Coverity: Fix leaking UCharsetDetector in ftp code. (Closed)
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/data/ftp/dir-listing-ls-1-utf8.expected ('k') | net/ftp/ftp_directory_listing_buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_directory_listing_buffer.cc
diff --git a/net/ftp/ftp_directory_listing_buffer.cc b/net/ftp/ftp_directory_listing_buffer.cc
index 030da83d7cd4c145ce1c7f2fecf2166a60c86403..d7833e8cecf9d60e47e520d5f40e0d37624be2e2 100644
--- a/net/ftp/ftp_directory_listing_buffer.cc
+++ b/net/ftp/ftp_directory_listing_buffer.cc
@@ -27,6 +27,7 @@ std::string DetectEncoding(const std::string& text) {
&status);
const UCharsetMatch* match = ucsdet_detect(detector, &status);
const char* encoding = ucsdet_getName(match, &status);
+ ucsdet_close(detector);
// Should we check the quality of the match? A rather arbitrary number is
// assigned by ICU and it's hard to come up with a lower limit.
if (U_FAILURE(status))
« no previous file with comments | « net/data/ftp/dir-listing-ls-1-utf8.expected ('k') | net/ftp/ftp_directory_listing_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698