[PATCH v4 09/12] Fix various memory leaks in transport-helper.c

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

 



Found with:
valgrind --tool=memcheck --leak-check=full --show-reachable=yes

Signed-off-by: Sverre Rabbelier <srabbelier@xxxxxxxxx>
---

	These are mine, Daniel, please verify for saneness.

 transport-helper.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/transport-helper.c b/transport-helper.c
index da8185a..628a5ca 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -74,6 +74,7 @@ static struct child_process *get_helper(struct transport *transport)
 		}
 		free(refspecs);
 	}
+	strbuf_release(&buf);
 	return data->helper;
 }
 
@@ -163,6 +164,8 @@ static int fetch_with_import(struct transport *transport,
 	}
 	disconnect_helper(transport);
 	finish_command(&fastimport);
+	free(fastimport.argv);
+	fastimport.argv = NULL;
 
 	for (i = 0; i < nr_heads; i++) {
 		char *private;
@@ -176,6 +179,7 @@ static int fetch_with_import(struct transport *transport,
 		read_ref(private, posn->old_sha1);
 		free(private);
 	}
+	strbuf_release(&buf);
 	return 0;
 }
 
-- 
1.6.5.3.164.g07b0c

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]