diff options
author | Jiawen Liu <liujiawen10@huawei.com> | 2019-08-06 10:35:29 +0800 |
---|---|---|
committer | Pavel Shilovsky <pshilov@microsoft.com> | 2019-08-07 14:38:02 -0700 |
commit | bf7f48f4c7dcee623bd92b2e7a6ffd97a64a1138 (patch) | |
tree | e9beb8a2c2ac9f57564db51c1b01df128c0eaca9 /setcifsacl.c | |
parent | 13c370424575d864544bfb4535832dfcffa91e82 (diff) | |
download | cifs-utils-bf7f48f4c7dcee623bd92b2e7a6ffd97a64a1138.tar.gz cifs-utils-bf7f48f4c7dcee623bd92b2e7a6ffd97a64a1138.tar.bz2 cifs-utils-bf7f48f4c7dcee623bd92b2e7a6ffd97a64a1138.zip |
mount.cifs.c: fix memory leaks in main func
In mount.cifs module, orgoptions and mountpoint in the main func
point to the memory allocated by func realpath and strndup respectively.
However, they are not freed before the main func returns so that the
memory leaks occurred.
The memory leak problem is reported by LeakSanitizer tool.
LeakSanitizer url: "https://github.com/google/sanitizers"
Here I free the pointers orgoptions and mountpoint before main
func returns.
Fixes:7549ad5e7126 ("memory leaks: caused by func realpath and strndup")
Signed-off-by: Jiawen Liu <liujiawen10@huawei.com>
Reported-by: Jin Du <dujin1@huawei.com>
Reviewed-by: Saisai Zhang <zhangsaisai@huawei.com>
Reviewed-by: Aurélien Aptel <aaptel@suse.com>
Diffstat (limited to 'setcifsacl.c')
0 files changed, 0 insertions, 0 deletions