]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add API to clear request_data
authorAlan T. DeKok <aland@freeradius.org>
Mon, 9 Dec 2019 22:00:09 +0000 (17:00 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 9 Dec 2019 22:00:09 +0000 (17:00 -0500)
src/lib/server/request_data.c
src/lib/server/request_data.h

index 120bddaad33f8c9a440d865b6e200c2d9a2d55ae..aaf8d6ba5d955b7bdcd5ad8bf1c6353678407360 100644 (file)
@@ -653,3 +653,17 @@ bool request_data_verify_parent(TALLOC_CTX *parent, fr_dlist_head_t *entry)
        return true;
 }
 #endif
+
+/** Clear all of the request data associated with a request.
+ *
+ */
+int request_data_clear(REQUEST *request)
+{
+       request_data_t  *rd = NULL;
+
+       while ((rd = fr_dlist_next(&request->data, rd))) {
+               if (talloc_free(rd) < 0) return -1;
+       }
+
+       return 0;
+}
index a09fe1baeb1401d5a32549360fd571e9a1553d7a..c6c521b01e5bb48f410487a7e3e5117dac2122e2 100644 (file)
@@ -75,6 +75,8 @@ bool          request_data_persistable(request_data_t *rd);
 bool           request_data_verify_parent(TALLOC_CTX *parent, fr_dlist_head_t *entry);
 #endif
 
+int            request_data_clear(REQUEST *request);
+
 #ifdef __cplusplus
 }
 #endif