Skip to content

Commit f373755

Browse files
authored
Cripts: tighten context cleanup (#12725)
1 parent 3f2b5c8 commit f373755

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

include/cripts/Urls.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,14 @@ namespace Client
654654
void operator=(const self_type &) = delete;
655655

656656
// We must not release the bufp etc. since it comes from the RRI structure
657+
// However, we still need to clear cached data in query and path components
657658
void
658659
Reset() override
659660
{
661+
query.Reset();
662+
path.Reset();
663+
_initialized = false;
664+
_modified = false;
660665
}
661666

662667
static self_type &_get(cripts::Context *context);

src/cripts/Context.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Context::Factory(TSHttpTxn txn_ptr, TSHttpSsn ssn_ptr, TSRemapRequestInfo *rri_p
6969
void
7070
Context::Release()
7171
{
72+
reset(); // Clear mloc handles before freeing
7273
THREAD_FREE(this, criptContextAllocator, this_thread());
7374
}
7475

src/cripts/Urls.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Url::Path::Reset()
197197
Component::Reset();
198198

199199
_segments.clear();
200-
_storage = "";
200+
_storage.clear();
201201
_size = 0;
202202
_modified = false;
203203
}
@@ -402,7 +402,7 @@ Url::Query::Reset()
402402

403403
_ordered.clear();
404404
_hashed.clear();
405-
_storage = "";
405+
_storage.clear();
406406
_size = 0;
407407
_modified = false;
408408
}

0 commit comments

Comments
 (0)