diff options
author | Ian Kent <raven@themaw.net> | 2021-04-09 10:41:25 +0800 |
---|---|---|
committer | Ian Kent <raven@themaw.net> | 2021-04-12 13:14:16 +0800 |
commit | f69332596c58b60549c39e92d97a9c030c60eab8 (patch) | |
tree | 0255549ad193722fce0590125b308041a4f20110 | |
parent | 53bf895ca57dc49eacf22138c1d66ec0e7723ca4 (diff) | |
download | autofs-f69332596c58b60549c39e92d97a9c030c60eab8.tar.gz |
autofs-5.1.7 - fix possible memory leak in master_parse()
Coverity: Overwriting "path" in "path = master_strdup(yyvsp[-1].strtype)"
leaks the storage that "path" points to.
Signed-off-by: Ian Kent <raven@themaw.net>
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | daemon/master_parse.y | 2 |
2 files changed, 3 insertions, 0 deletions
@@ -52,6 +52,7 @@ - remove unused variable from get_exports(). - add missing free in handle_mounts(). - remove redundant if check. +- fix possible memory leak in master_parse(). 25/01/2021 autofs-5.1.7 - make bind mounts propagation slave by default. diff --git a/daemon/master_parse.y b/daemon/master_parse.y index 08e44b57..7480c36a 100644 --- a/daemon/master_parse.y +++ b/daemon/master_parse.y @@ -155,6 +155,8 @@ file: { line: | PATH mapspec { + if (path) + free(path); path = master_strdup($1); if (!path) { local_free_vars(); |