[PACKET_IO]add gtest case
This commit is contained in:
@@ -302,11 +302,13 @@ ssize_t pio_pcap_file_device_close(struct packet_io_device *pdev)
|
||||
}
|
||||
|
||||
if (pdev->entity.pcap_file_dev_ctx != nullptr) {
|
||||
if (pdev->entity.pcap_file_dev_ctx->entity.file != nullptr) {
|
||||
if (!pdev->entity.pcap_file_dev_ctx->is_dir &&
|
||||
pdev->entity.pcap_file_dev_ctx->entity.file != nullptr) {
|
||||
cleanup_pcap_plain_file_info(pdev->entity.pcap_file_dev_ctx->entity.file);
|
||||
}
|
||||
|
||||
if (pdev->entity.pcap_file_dev_ctx->entity.dir != nullptr) {
|
||||
if (pdev->entity.pcap_file_dev_ctx->is_dir &&
|
||||
pdev->entity.pcap_file_dev_ctx->entity.dir != nullptr) {
|
||||
cleanup_pcap_directory_info(pdev->entity.pcap_file_dev_ctx->entity.dir);
|
||||
}
|
||||
|
||||
@@ -315,9 +317,9 @@ ssize_t pio_pcap_file_device_close(struct packet_io_device *pdev)
|
||||
release_pio_packet_queue(&pdev->entity.pcap_file_dev_ctx->pkt_queues[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FREE(pdev->entity.pcap_file_dev_ctx);
|
||||
FREE(pdev->entity.pcap_file_dev_ctx);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user