Don't leak memory in the filesystem drivers.
authorcoderain <coderain@sdf.org>
Mon, 27 Feb 2017 05:32:58 +0000 (06:32 +0100)
committercoderain <coderain@sdf.org>
Mon, 27 Feb 2017 05:32:58 +0000 (06:32 +0100)
kernel/src/drivers/fs/fat.c
kernel/src/drivers/fs/ram.c

index b59f695556f7a67fd24a187aa77de7ac9ac14f14..f766fc052712b92cbf2a1ec4a66f0547629e09c3 100644 (file)
@@ -663,6 +663,7 @@ static dword_t fatfs_unmount(mounted_volume_t *volume)
     dword_t ret = unregister_mounted_volume(volume);
     if (ret != ERR_SUCCESS) return ret;
 
+    free(volume->mountpoint);
     free(volume);
     return ERR_SUCCESS;
 }
index 70c35ccc8f4b96cd07276723736c6240a62773d8..6cf6c4a5eb00d42eb522faf01f9a9ff8a6809b02 100644 (file)
@@ -161,6 +161,7 @@ static dword_t ramfs_unmount(mounted_volume_t *_volume)
     ramfs_release_node_recursive(&volume->root);
 
     unregister_mounted_volume(&volume->header);
+    free(volume->header.mountpoint);
     free(volume);
     return ERR_SUCCESS;
 }