]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
netapp-nvme: free the nsdescs pointer after use
authorMartin George <marting@netapp.com>
Tue, 22 Feb 2022 07:39:39 +0000 (13:09 +0530)
committerMartin George <marting@netapp.com>
Tue, 22 Feb 2022 07:39:39 +0000 (13:09 +0530)
Ensure the nsdescs pointer is freed after use in
netapp_ontapdevices_get_info().

Fixes: 476d019 ("netapp-nvme: fix nvme ns desc uuid handling
for ontapdevices")

Signed-off-by: Martin George <marting@netapp.com>
plugins/netapp/netapp-nvme.c

index d5c6d6cddd0ea033825935e89a2043e99a850e60..fa8943bd5635314e24bd65a415acbc6757e10f23 100644 (file)
@@ -449,6 +449,7 @@ static int netapp_ontapdevices_get_info(int fd, struct ontapdevice_info *item,
        }
 
        memcpy(item->uuid, nsdescs + sizeof(struct nvme_ns_id_desc), sizeof(item->uuid));
+       free(nsdescs);
 
        err = nvme_get_ontap_c2_log(fd, item->nsid, item->log_data, ONTAP_C2_LOG_SIZE);
        if (err) {