Skip to content

Commit

Permalink
address memory leak as per code review comment from wangshilong
Browse files Browse the repository at this point in the history
Features: nvme control
Required-githooks: true

Signed-off-by: Tom Nabarro <[email protected]>
  • Loading branch information
tanabarr committed Jan 22, 2024
1 parent a9c9ece commit b423777
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mgmt/srv_drpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,8 +1973,12 @@ ds_mgmt_smd_free_dev(Ctl__SmdDevice *dev)
D_FREE(dev->ctrlr->fw_rev);
D_FREE(dev->ctrlr->vendor_id);
D_FREE(dev->ctrlr->pci_dev_type);
if (dev->ctrlr->namespaces != NULL)
if (dev->ctrlr->namespaces != NULL) {
D_FREE(dev->ctrlr->namespaces[0]);
D_FREE(dev->ctrlr->namespaces);
dev->ctrlr->namespaces = NULL;
dev->ctrlr->n_namespaces = 0;
}
}
}

Expand Down

0 comments on commit b423777

Please sign in to comment.