[PATCH rtems] dosfs: Fix memory leak on failed mounts.

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Aug 3 14:16:02 UTC 2020


On 03/08/2020 15:16, Christian Mauderer wrote:

> @@ -270,6 +273,10 @@ typedef struct {
>      *       RTEMS_FILESYSTEM_READ_WRITE,
>      *       &mount_opts
>      *     );
> +   *
> +   *     if (rv != 0) {
> +   *       mount_opts.converter->handler->destroy(mount_opts.converter);
> +   *     }
>      *   } else {
>      *     rv = -1;
>      *     errno = ENOMEM;

I think most code uses

(*mount_opts.converter->handler->destroy)(mount_opts.converter);

for function pointer calls.



More information about the devel mailing list