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;
```
This commit is contained in:
Gerald Combs 2023-11-09 11:08:32 -08:00
parent 4365250098
commit 0520153cb5
1 changed files with 1 additions and 1 deletions

View File

@ -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) {