[PATCH 07/19] Removed resource leaks from nfs/xlog.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



nfs/xlog.c:139: leaked_storage: Variable "kinds" going out
	of scope leaks the storage it points to.

nfs/xlog.c:142: leaked_storage: Variable "kinds" going out
	of scope leaks the storage it points to.

Signed-off-by: Steve Dickson <steved@xxxxxxxxxx>
---
 support/nfs/xlog.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/support/nfs/xlog.c b/support/nfs/xlog.c
index f75a9ab..687d862 100644
--- a/support/nfs/xlog.c
+++ b/support/nfs/xlog.c
@@ -135,10 +135,14 @@ xlog_from_conffile(char *service)
 	struct conf_list_node *n;
 
 	kinds = conf_get_list(service, "debug");
-	if (!kinds || !kinds->cnt)
+	if (!kinds || !kinds->cnt) {
+		free(kinds);
 		return;
+	}
 	TAILQ_FOREACH(n, &(kinds->fields), link)
 		xlog_sconfig(n->field, 1);
+
+	conf_free_list(kinds);
 }
 
 int
-- 
2.20.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux