diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 21:21:28 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 21:21:28 +0000 |
commit | 976ac95f184b6a9565f0ff38b6490282882fe3ae (patch) | |
tree | 38462f8d598716a0f073636f12b1f434922d59a4 /printing | |
parent | e141ba3c795c691028511d4de131472db3bbb3c2 (diff) | |
download | chromium_src-976ac95f184b6a9565f0ff38b6490282882fe3ae.zip chromium_src-976ac95f184b6a9565f0ff38b6490282882fe3ae.tar.gz chromium_src-976ac95f184b6a9565f0ff38b6490282882fe3ae.tar.bz2 |
Valgrind: Fix some leaks in the CUPS printing code and remove a no longer supported OS X 10.5 check.
Review URL: https://chromiumcodereview.appspot.com/10908022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/backend/print_backend_cups.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/printing/backend/print_backend_cups.cc b/printing/backend/print_backend_cups.cc index 5c515f16..82c25f3 100644 --- a/printing/backend/print_backend_cups.cc +++ b/printing/backend/print_backend_cups.cc @@ -26,10 +26,7 @@ #include "printing/backend/cups_helper.h" #include "printing/backend/print_backend_consts.h" -#if (defined(OS_MACOSX) && \ - MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5) || \ - (defined(OS_LINUX) && \ - CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 4) +#if (CUPS_VERSION_MAJOR == 1 && CUPS_VERSION_MINOR < 4) const int CUPS_PRINTER_SCANNER = 0x2000000; // Scanner-only device #endif @@ -210,7 +207,9 @@ std::string PrintBackendCUPS::GetDefaultPrinterName() { cups_dest_t* dests; int num_dests = GetDests(&dests); cups_dest_t* dest = cupsGetDest(NULL, NULL, num_dests, dests); - return dest ? std::string(dest->name) : std::string(); + std::string name = dest ? std::string(dest->name) : std::string(); + cupsFreeDests(num_dests, dests); + return name; } bool PrintBackendCUPS::GetPrinterSemanticCapsAndDefaults( |