Fixed a leak.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15234 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2021-12-12 09:23:14 +00:00
parent 10189b4178
commit 9c750d6aeb
1 changed files with 5 additions and 1 deletions

View File

@ -155,7 +155,7 @@ static msg_t drv_open_dir(void *instance,
could fail, in that case the pointer stays at NULL.*/ could fail, in that case the pointer stays at NULL.*/
if (drvp->overlaid_drv != NULL) { if (drvp->overlaid_drv != NULL) {
(void) drvp->overlaid_drv->vmt->open_dir((void *)drvp->overlaid_drv, (void) drvp->overlaid_drv->vmt->open_dir((void *)drvp->overlaid_drv,
"/", drvp->path_prefix == NULL ? "/" : drvp->path_prefix,
&odnp->overlaid_root); &odnp->overlaid_root);
} }
@ -269,6 +269,10 @@ static void node_dir_release(void *instance) {
__referenced_object_release_impl(instance); __referenced_object_release_impl(instance);
if (__referenced_object_getref_impl(instance) == 0U) { if (__referenced_object_getref_impl(instance) == 0U) {
if (odnp->overlaid_root != NULL) {
odnp->overlaid_root->vmt->release((void *)odnp->overlaid_root);
}
chPoolFree(&vfs_overlay_driver_static.dir_nodes_pool, (void *)odnp); chPoolFree(&vfs_overlay_driver_static.dir_nodes_pool, (void *)odnp);
} }
} }