Skip to content

Commit fe4f622

Browse files
tbzatekigaw
authored andcommitted
tree: Explicitly initialize auto-cleanup variables
gcc complains about potentially uninitialized variables. Signed-off-by: Tomas Bzatek <[email protected]>
1 parent 3389703 commit fe4f622

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/nvme/tree.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ static void cleanup_dirents(struct dirents *ents)
122122
nvme_host_t nvme_default_host(nvme_root_t r)
123123
{
124124
struct nvme_host *h;
125-
_cleanup_free_ char *hostnqn, *hostid;
125+
_cleanup_free_ char *hostnqn = NULL;
126+
_cleanup_free_ char *hostid = NULL;
126127

127128
hostnqn = nvmf_hostnqn_from_file();
128129
if (!hostnqn)
@@ -1853,7 +1854,7 @@ static nvme_ctrl_t nvme_ctrl_alloc(nvme_root_t r, nvme_subsystem_t s,
18531854
nvme_ctrl_t c, p;
18541855
_cleanup_free_ char *addr = NULL, *address = NULL;
18551856
char *a, *e;
1856-
_cleanup_free_ char *transport;
1857+
_cleanup_free_ char *transport = NULL;
18571858
char *traddr = NULL, *trsvcid = NULL;
18581859
char *host_traddr = NULL, *host_iface = NULL;
18591860
int ret;

0 commit comments

Comments
 (0)