From 704554cdf07c2cdbefbf586c1ea4e8af35c720db Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 15 Feb 2016 11:37:48 +0100 Subject: [PATCH] transports: smart: fix memory leak on OOM path --- src/transports/smart_protocol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c index 1d46d4bc9..6363378ec 100644 --- a/src/transports/smart_protocol.c +++ b/src/transports/smart_protocol.c @@ -108,6 +108,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr) if (giterr_last()->klass != GITERR_NOMEMORY) goto on_invalid; + git__free(mapping); return error; } @@ -120,6 +121,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr) on_invalid: giterr_set(GITERR_NET, "remote sent invalid symref"); git_refspec__free(mapping); + git__free(mapping); return -1; }