diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-01 11:51:45 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-01 11:51:45 +0100 |
commit | 17df34e290602b37a17fdf3644b2e1faecb6cc4e (patch) | |
tree | 9147fa7bef682ede9375d6fcc65d099241b36d74 /libnetfs | |
parent | 0affb938ada6ae0572695c62df9c64a8109b971d (diff) | |
download | hurd-17df34e290602b37a17fdf3644b2e1faecb6cc4e.tar.gz hurd-17df34e290602b37a17fdf3644b2e1faecb6cc4e.tar.bz2 hurd-17df34e290602b37a17fdf3644b2e1faecb6cc4e.zip |
libnetfs: fix memory leak on error
Diffstat (limited to 'libnetfs')
-rw-r--r-- | libnetfs/file-get-translator.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libnetfs/file-get-translator.c b/libnetfs/file-get-translator.c index 2dff6a13..8e8c3eb6 100644 --- a/libnetfs/file-get-translator.c +++ b/libnetfs/file-get-translator.c @@ -62,6 +62,9 @@ netfs_S_file_get_translator (struct protid *user, (*trans)[sizeof _HURD_SYMLINK + np->nn_stat.st_size] = '\0'; *translen = len; } + else + if (len > *translen) + munmap (*trans, len); } else if (S_ISCHR (np->nn_stat.st_mode) || S_ISBLK (np->nn_stat.st_mode)) { |