Skip to content

Commit cd5ac30

Browse files
committed
tree: fixup coredump during nvme discover
nvme_free_ctrl() expects the 'trsvcid' string to be dynamically allocated; just calling 'stringify' will cause a coredump on exit. Signed-off-by: Hannes Reinecke <[email protected]>
1 parent 8ab2ba6 commit cd5ac30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/nvme/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ static void discovery_trsvcid(nvme_ctrl_t c)
941941
c->trsvcid = strdup(__stringify(NVME_DISC_IP_PORT));
942942
} else {
943943
/* Default port for NVMe/TCP io controllers */
944-
c->trsvcid = __stringify(NVME_RDMA_IP_PORT);
944+
c->trsvcid = strdup(__stringify(NVME_RDMA_IP_PORT));
945945
}
946946
} else if (!strcmp(c->transport, "rdma")) {
947947
/* Default port for NVMe/RDMA controllers */

0 commit comments

Comments
 (0)