diff options
author | Gerald Combs <gerald@wireshark.org> | 2023-11-09 11:08:32 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2023-11-09 23:21:57 +0000 |
commit | 0520153cb5b238c9d3e7f79f901ed85d388adbd2 (patch) | |
tree | 945dd48caef35c5164f9bfee3712f8660bfc71b7 /epan/uat.c | |
parent | 43652500988a170aee652b4236de4af7afef54e7 (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.c | 2 |
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) { |