This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 607783448e Coverity 1534638: Resource leak in object for
stale_response plugin (#11323)
607783448e is described below
commit 607783448efa9c096025504c68d2e4b535c5d4cd
Author: Bryan Call <[email protected]>
AuthorDate: Tue May 7 08:58:00 2024 -0600
Coverity 1534638: Resource leak in object for stale_response plugin (#11323)
---
plugins/experimental/stale_response/stale_response.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/plugins/experimental/stale_response/stale_response.h
b/plugins/experimental/stale_response/stale_response.h
index 8dc44ae7fa..0fa4087d79 100644
--- a/plugins/experimental/stale_response/stale_response.h
+++ b/plugins/experimental/stale_response/stale_response.h
@@ -26,6 +26,7 @@
#include "ts/apidefs.h"
#include "ts_wrap.h"
#include "ts/ts.h"
+#include "BodyData.h"
#include <cstdint>
#include <map>
@@ -51,6 +52,18 @@ struct LogInfo {
struct ConfigInfo {
ConfigInfo() : body_data{new UintBodyMap()},
body_data_mutex(TSMutexCreate()) {}
+ ~ConfigInfo()
+ {
+ if (this->body_data) {
+ for (auto &it : *this->body_data) {
+ delete it.second;
+ }
+ delete this->body_data;
+ }
+ if (this->body_data_mutex) {
+ TSMutexDestroy(this->body_data_mutex);
+ }
+ }
UintBodyMap *body_data = nullptr;
TSMutex body_data_mutex;
int64_t body_data_memory_usage = 0;