Skip to content

Commit

Permalink
tree: Explicitly initialize auto-cleanup variables
Browse files Browse the repository at this point in the history
gcc complains about potentially uninitialized variables.

Signed-off-by: Tomas Bzatek <[email protected]>
  • Loading branch information
tbzatek authored and igaw committed Jan 18, 2024
1 parent 3389703 commit fe4f622
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nvme/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ static void cleanup_dirents(struct dirents *ents)
nvme_host_t nvme_default_host(nvme_root_t r)
{
struct nvme_host *h;
_cleanup_free_ char *hostnqn, *hostid;
_cleanup_free_ char *hostnqn = NULL;
_cleanup_free_ char *hostid = NULL;

hostnqn = nvmf_hostnqn_from_file();
if (!hostnqn)
Expand Down Expand Up @@ -1853,7 +1854,7 @@ static nvme_ctrl_t nvme_ctrl_alloc(nvme_root_t r, nvme_subsystem_t s,
nvme_ctrl_t c, p;
_cleanup_free_ char *addr = NULL, *address = NULL;
char *a, *e;
_cleanup_free_ char *transport;
_cleanup_free_ char *transport = NULL;
char *traddr = NULL, *trsvcid = NULL;
char *host_traddr = NULL, *host_iface = NULL;
int ret;
Expand Down

0 comments on commit fe4f622

Please sign in to comment.