From: Michael R Sweet Date: Thu, 25 Sep 2025 19:14:44 +0000 (-0400) Subject: Fix clang-detected issues. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9dab50d48973e2abec255183e3013c16105881d4;p=thirdparty%2Fcups.git Fix clang-detected issues. --- diff --git a/cups/file.c b/cups/file.c index 37a0301e79..e7717188cf 100644 --- a/cups/file.c +++ b/cups/file.c @@ -2215,7 +2215,9 @@ cups_open(const char *filename, // I - Filename // Then verify that the file descriptor doesn't point to a directory or hard-linked file. if (fstat(fd, &fileinfo)) { + int temp = errno; close(fd); + errno = temp; return (-1); } @@ -2241,7 +2243,9 @@ cups_open(const char *filename, // I - Filename // Then use lstat to determine whether the filename is a symlink... if (lstat(filename, &linkinfo)) { + int temp = errno; close(fd); + errno = temp; return (-1); } diff --git a/cups/ipp-file.c b/cups/ipp-file.c index 0a6e61430c..c3bec5ef17 100644 --- a/cups/ipp-file.c +++ b/cups/ipp-file.c @@ -33,7 +33,6 @@ struct _ipp_file_s // IPP data file cups_option_t *vars; // Variables ipp_fattr_cb_t attr_cb; // Attribute (filter) callback ipp_ferror_cb_t error_cb; // Error reporting callback - ipp_ftoken_cb_t token_cb; // Token processing callback void *cb_data; // Callback data char *buffer; // Output buffer size_t alloc_buffer; // Size of output buffer diff --git a/cups/oauth.c b/cups/oauth.c index 5ede7edfba..0388cb15f6 100644 --- a/cups/oauth.c +++ b/cups/oauth.c @@ -1331,12 +1331,15 @@ cupsOAuthGetTokens( if (error) { - // Handle "soft" device access token errors by setting access_expires to - // the next call time... - if (!strcmp(error, "slow_down")) - *access_expires = time(NULL) + 10; - else - *access_expires = time(NULL) + 5; + if (access_expires) + { + // Handle "soft" device access token errors by setting access_expires to + // the next call time... + if (!strcmp(error, "slow_down")) + *access_expires = time(NULL) + 10; + else + *access_expires = time(NULL) + 5; + } // Free memory and return... cupsJSONDelete(response);