The name and part of devfs links are always dynamically allocated, so make sure to free them once we are done with them. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- fs/devfs-core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/devfs-core.c b/fs/devfs-core.c index 0bb363d0a9ff..0651be3d8fc4 100644 --- a/fs/devfs-core.c +++ b/fs/devfs-core.c @@ -428,8 +428,11 @@ int devfs_remove(struct cdev *cdev) if (cdev_is_partition(cdev)) list_del(&cdev->partition_entry); - if (cdev->link) + if (cdev->link) { + free(cdev->name); + free(cdev->partname); free(cdev); + } return 0; } -- 2.39.5