diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-05-22 12:28:39 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-05-22 12:28:39 +0200 |
commit | 4c4408c351650dac84c81a67a321a4d92cc85ffa (patch) | |
tree | 4fc65c781b55e7092f8e58b34a5c5bd65f2af7f6 /src/transports/smart_protocol.c | |
parent | a598264463442da0013d6e8b6a0c93d075e14d3a (diff) | |
download | libgit2-4c4408c351650dac84c81a67a321a4d92cc85ffa.tar.gz |
Plug leaks and fix a C99-ism
We have too many places where we repeat free code, so when adding the
new free to the generic code, it didn't take for the local transport.
While there, fix a C99-ism that sneaked through.
Diffstat (limited to 'src/transports/smart_protocol.c')
-rw-r--r-- | src/transports/smart_protocol.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c index bab0cf113..a52aacc60 100644 --- a/src/transports/smart_protocol.c +++ b/src/transports/smart_protocol.c @@ -26,17 +26,16 @@ int git_smart__store_refs(transport_smart *t, int flushes) int error, flush = 0, recvd; const char *line_end = NULL; git_pkt *pkt = NULL; - git_pkt_ref *ref; size_t i; /* Clear existing refs in case git_remote_connect() is called again * after git_remote_disconnect(). */ - git_vector_foreach(refs, i, ref) { - git__free(ref->head.name); - git__free(ref); + git_vector_foreach(refs, i, pkt) { + git_pkt_free(pkt); } git_vector_clear(refs); + pkt = NULL; do { if (buf->offset > 0) |