diff mbox series

[18/19] Removed a resource leak from mountd/fsloc.c

Message ID 20190508133536.6077-19-steved@redhat.com (mailing list archive)
State New, archived
Headers show
Series Covertity Scan: Removed resources leaks | expand

Commit Message

Steve Dickson May 8, 2019, 1:35 p.m. UTC
mountd/fsloc.c:97: overwrite_var: Overwriting "mp" in
	"mp = calloc(1UL, 16UL)" leaks the storage that "mp" points to.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mountd/fsloc.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/utils/mountd/fsloc.c b/utils/mountd/fsloc.c
index bc737d1..cf42944 100644
--- a/utils/mountd/fsloc.c
+++ b/utils/mountd/fsloc.c
@@ -102,6 +102,7 @@  static struct servers *parse_list(char **list)
 		cp = strchr(list[i], '@');
 		if ((!cp) || list[i][0] != '/') {
 			xlog(L_WARNING, "invalid entry '%s'", list[i]);
+			free(mp);
 			continue; /* XXX Need better error handling */
 		}
 		res->h_mp[i] = mp;