Skip to content

Commit a33a5be

Browse files
Copilotigaw
andauthored
fabrics: make remaining libnvmf free APIs explicitly NULL-safe
Agent-Logs-Url: https://github.com/igaw/nvme-cli/sessions/70a74f29-e472-4a90-aa27-9f67c9a6907e Co-authored-by: igaw <1050803+igaw@users.noreply.github.com>
1 parent 0a2eb77 commit a33a5be

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

libnvme/src/nvme/fabrics.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,9 @@ __public int libnvmf_discovery_args_create(struct libnvmf_discovery_args **argsp
15171517

15181518
__public void libnvmf_discovery_args_free(struct libnvmf_discovery_args *args)
15191519
{
1520+
if (!args)
1521+
return;
1522+
15201523
free(args);
15211524
}
15221525

@@ -2642,6 +2645,9 @@ __public int libnvmf_nbft_read_files(struct libnvme_global_ctx *ctx, char *path,
26422645

26432646
__public void libnvmf_nbft_free(struct libnvme_global_ctx *ctx, struct nbft_file_entry *head)
26442647
{
2648+
if (!head)
2649+
return;
2650+
26452651
while (head) {
26462652
struct nbft_file_entry *next = head->next;
26472653

0 commit comments

Comments
 (0)