Commit a9e1339c by Ben Straub

Fix a leak when canceling a network operation

parent 2fe67aeb
...@@ -493,10 +493,11 @@ int git_smart__download_pack( ...@@ -493,10 +493,11 @@ int git_smart__download_pack(
git__free(pkt); git__free(pkt);
} else if (pkt->type == GIT_PKT_DATA) { } else if (pkt->type == GIT_PKT_DATA) {
git_pkt_data *p = (git_pkt_data *) pkt; git_pkt_data *p = (git_pkt_data *) pkt;
if ((error = writepack->add(writepack, p->data, p->len, stats)) < 0) error = writepack->add(writepack, p->data, p->len, stats);
goto on_error;
git__free(pkt); git__free(pkt);
if (error < 0)
goto on_error;
} else if (pkt->type == GIT_PKT_FLUSH) { } else if (pkt->type == GIT_PKT_FLUSH) {
/* A flush indicates the end of the packfile */ /* A flush indicates the end of the packfile */
git__free(pkt); git__free(pkt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment