Skip to content

Commit

Permalink
Valgrind: Fix some leaks in the CUPS printing code and remove a no lo…
Browse files Browse the repository at this point in the history
…nger 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
  • Loading branch information
thestig@chromium.org committed Sep 7, 2012
1 parent e141ba3 commit 976ac95
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions printing/backend/print_backend_cups.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 976ac95

Please sign in to comment.