diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-11-18 21:40:19 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-11-18 21:40:19 +0100 |
commit | e1ce5249e52e9c5271727d7e2ef5bba4c45277b9 (patch) | |
tree | bb30be4ddd9d3b57f8048618a38b91ca8f06fc0a | |
parent | 8f2a3d6251291c0468e074563e16d4c41f59acb1 (diff) | |
download | libgit2-e1ce5249e52e9c5271727d7e2ef5bba4c45277b9.tar.gz |
netops: fix leak
-rw-r--r-- | src/netops.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/netops.c b/src/netops.c index 15ed0fc26..ad27d84cf 100644 --- a/src/netops.c +++ b/src/netops.c @@ -632,10 +632,13 @@ int gitno_connection_data_from_url( size_t suffixlen = service_suffix ? strlen(service_suffix) : 0; if (suffixlen && - !memcmp(path + pathlen - suffixlen, service_suffix, suffixlen)) + !memcmp(path + pathlen - suffixlen, service_suffix, suffixlen)) { + git__free(data->path); data->path = git__strndup(path, pathlen - suffixlen); - else + } else { + git__free(data->path); data->path = git__strdup(path); + } /* Check for errors in the resulting data */ if (original_host && url[0] != '/' && strcmp(original_host, data->host)) { |