aboutsummaryrefslogtreecommitdiffstats
path: root/epan/uat.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2023-11-09 11:08:32 -0800
committerGerald Combs <gerald@wireshark.org>2023-11-09 23:21:57 +0000
commit0520153cb5b238c9d3e7f79f901ed85d388adbd2 (patch)
tree945dd48caef35c5164f9bfee3712f8660bfc71b7 /epan/uat.c
parent43652500988a170aee652b4236de4af7afef54e7 (diff)
UAT: Fix a Coverity warning
Swap a couple of lines to avoid the following warning, which otherwise appears to be harmless: ``` *** CID 1548633: Memory - illegal accesses (USE_AFTER_FREE) /builds/wireshark/wireshark/epan/uat.c: 529 in uat_destroy() 523 g_ptr_array_free(all_uats,true); 524 } 525 526 void uat_destroy(uat_t *uat) 527 { 528 free_uat(uat); >>> CID 1548633: Memory - illegal accesses (USE_AFTER_FREE) >>> Passing freed pointer "uat" as an argument to "g_ptr_array_remove". 529 g_ptr_array_remove(all_uats, uat); 530 } 531 532 void uat_foreach_table(uat_cb_t cb,void* user_data) { 533 unsigned i; ```
Diffstat (limited to 'epan/uat.c')
-rw-r--r--epan/uat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/uat.c b/epan/uat.c
index 1221426318..6fca2badda 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -525,8 +525,8 @@ void uat_cleanup(void) {
void uat_destroy(uat_t *uat)
{
- free_uat(uat);
g_ptr_array_remove(all_uats, uat);
+ free_uat(uat);
}
void uat_foreach_table(uat_cb_t cb,void* user_data) {