diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2024-01-24 19:27:01 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2024-01-24 20:20:02 -0500 |
| commit | bae20ff33bb6a6ea49f33fab285a66b55bb31220 (patch) | |
| tree | 6f0dc133bbd1d6fefc0c723989f74dfe45de9c8d /pceplib/test/pcep_msg_tlvs_test.c | |
| parent | aa474cf7b01b93cfb3444d45971e106c9cdc1ef4 (diff) | |
pceplib: Fix some new coverity issues that trickled in
Several new issues came in because the coverity build system
was not building the test infrastrucuture for the pceplib.
Now we do, so we fixed it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'pceplib/test/pcep_msg_tlvs_test.c')
| -rw-r--r-- | pceplib/test/pcep_msg_tlvs_test.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/pceplib/test/pcep_msg_tlvs_test.c b/pceplib/test/pcep_msg_tlvs_test.c index 3ead269a6f..5582c3f45f 100644 --- a/pceplib/test/pcep_msg_tlvs_test.c +++ b/pceplib/test/pcep_msg_tlvs_test.c @@ -105,10 +105,8 @@ void test_pcep_tlv_create_speaker_entity_id() double_linked_list *list = dll_initialize(); tlv = pcep_tlv_create_speaker_entity_id(list); CU_ASSERT_PTR_NULL(tlv); - if (tlv != NULL) { + if (tlv != NULL) pceplib_free(PCEPLIB_INFRA, tlv); - tlv = NULL; - } uint32_t *speaker_entity = pceplib_malloc(PCEPLIB_MESSAGES, sizeof(uint32_t)); @@ -179,28 +177,22 @@ void test_pcep_tlv_create_path_setup_type_capability() double_linked_list *pst_list = dll_initialize(); tlv = pcep_tlv_create_path_setup_type_capability(pst_list, NULL); CU_ASSERT_PTR_NULL(tlv); - if (tlv != NULL) { + if (tlv != NULL) pcep_obj_free_tlv(&tlv->header); - tlv = NULL; - } /* Should still return NULL if pst_list is NULL */ double_linked_list *sub_tlv_list = dll_initialize(); tlv = pcep_tlv_create_path_setup_type_capability(NULL, sub_tlv_list); CU_ASSERT_PTR_NULL(tlv); - if (tlv != NULL) { + if (tlv != NULL) pcep_obj_free_tlv(&tlv->header); - tlv = NULL; - } /* Should still return NULL if pst_list is empty */ tlv = pcep_tlv_create_path_setup_type_capability(pst_list, sub_tlv_list); CU_ASSERT_PTR_NULL(tlv); - if (tlv != NULL) { + if (tlv != NULL) pcep_obj_free_tlv(&tlv->header); - tlv = NULL; - } /* Test only populating the pst list */ uint8_t *pst1 = pceplib_malloc(PCEPLIB_MESSAGES, 1); |
