]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Quiet coverity
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 17 May 2024 20:53:30 +0000 (14:53 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 17 May 2024 20:53:43 +0000 (14:53 -0600)
src/modules/rlm_rest/rlm_rest.c

index ad75530006d7afae3479fa33798cdf8fee81d77a..956bcf67f7860f65d79ccc8e8842b7c950e296cd 100644 (file)
@@ -21,8 +21,6 @@
  *
  * @copyright 2012-2019,2024 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
  */
-
-#include <talloc.h>
 RCSID("$Id$")
 
 #include <freeradius-devel/curl/base.h>
@@ -47,6 +45,9 @@ RCSID("$Id$")
 #include <freeradius-devel/unlang/xlat_func.h>
 #include <freeradius-devel/unlang/xlat.h>
 
+#include <curl/curl.h>
+#include <talloc.h>
+
 #include "rest.h"
 
 static int rest_uri_part_escape(fr_value_box_t *vb, void *uctx);
@@ -1207,12 +1208,19 @@ static int _rest_request_cleanup(fr_curl_io_request_t *randle, UNUSED void *uctx
        }
 
 #ifndef NDEBUG
-       /*
-        *  With curl 7.61 when a request in cancelled we get a result
-        *  with a NULL (invalid) pointer to private data.  This lets
-        *  us know that it was request returned to the slab.
-        */
-       curl_easy_setopt(candle, CURLOPT_PRIVATE, (void *)0xdeadc341);
+       {
+               CURLcode ret;
+               /*
+                *  With curl 7.61 when a request in cancelled we get a result
+                *  with a NULL (invalid) pointer to private data.  This lets
+                *  us know that it was request returned to the slab.
+                */
+               ret = curl_easy_setopt(candle, CURLOPT_PRIVATE, (void *)0xdeadc341);
+               if (unlikely(ret != CURLE_OK)) {
+                       ERROR("Failed to set private data on curl easy handle %p: %s",
+                             candle, curl_easy_strerror(ret));
+               }
+       }
 #endif
 
        /*