]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix clang-detected issues.
authorMichael R Sweet <msweet@msweet.org>
Thu, 25 Sep 2025 19:14:44 +0000 (15:14 -0400)
committerMichael R Sweet <msweet@msweet.org>
Thu, 25 Sep 2025 19:14:44 +0000 (15:14 -0400)
cups/file.c
cups/ipp-file.c
cups/oauth.c

index 37a0301e79ae0be20ab0451cc46a62068df5a389..e7717188cff6b6e07ae49c768a6bb3a50e751a68 100644 (file)
@@ -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);
   }
 
index 0a6e61430c82c66b344b770f117df14a28b060ee..c3bec5ef17bd7519ec6fc2e9aa46874582b75bc8 100644 (file)
@@ -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
index 5ede7edfbab4548592a2112377cc47431e1275ac..0388cb15f61b7a47c8aa8fded04254d76ba2dfb7 100644 (file)
@@ -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);