Skip to contentSkip to conversation

libndctl: fix bb iterator leak in namespaces

PATCH New Vishal Verma 1 participant 1 message Jan 30, 2019 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 libndctl: fix bb iterator leak in namespaces

From: Piotr Balcer <[email protected]>

We were neglecting to free bb_iterator in free_namespace(), causing a memory leak. Close the leak by adding the required deallocation.

---

via github:pull/80

 ndctl/lib/libndctl.c | 1 +
 1 file changed, 1 insertion(+)
ndctl/lib/libndctl.c +1 -0
index 5eb915f..c9e2875 100644
@@ -461,6 +461,7 @@ static void free_namespace(struct ndctl_namespace *ndns, struct list_head *head)
 	free(ndns->ndns_buf);
 	free(ndns->bdev);
 	free(ndns->alt_name);
+	badblocks_iter_free(&ndns->bb_iter);
 	kmod_module_unref(ndns->module);
 	free(ndns);
 }
Signature · 6 lines
2.20.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm