diff options
author | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2020-08-03 14:18:33 +0200 |
---|---|---|
committer | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2020-08-04 08:24:17 +0200 |
commit | 87fdb206fa018bd1366434a5535e608eb7f45137 (patch) | |
tree | d700417998ea1edbbeea6d2a5c5d240b406bb4f0 /cpukit/libblock | |
parent | bsps/beagle: Remove some debug output from I2C. (diff) | |
download | rtems-87fdb206fa018bd1366434a5535e608eb7f45137.tar.bz2 |
dosfs: Fix memory leak on failed mounts.
Currently if mount fails, a converter isn't destroyed. We have to take
care of two cases:
1. The user doesn't provide a converter.
In this case mounting a dosfs creates a default converter. This patch
makes sure that the converter is destroyed again if mount failes for
this case.
2. The user provides a converter.
In this case it's not sure that the dosfs specific routines are reached
because mount can fail before that. Therefore the user has to destroy
the converter himself again. This patch adds a documentation for that
and implements it in the media server.
Closes #4042.
Diffstat (limited to 'cpukit/libblock')
-rw-r--r-- | cpukit/libblock/src/media.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cpukit/libblock/src/media.c b/cpukit/libblock/src/media.c index dd604d39bf..c176e12243 100644 --- a/cpukit/libblock/src/media.c +++ b/cpukit/libblock/src/media.c @@ -508,6 +508,7 @@ static rtems_status_code mount_worker( if (rv != 0) { rmdir(mount_path); free(mount_path); + (*mount_options.converter->handler->destroy)(mount_options.converter); return RTEMS_IO_ERROR; } |