Commit 2cf9b84c by Etienne Samson

smart: free the pkt when we fail to store it

parent 32586d5e
......@@ -256,14 +256,15 @@ static int store_common(transport_smart *t)
if ((error = recv_pkt(&pkt, NULL, buf)) < 0)
return error;
if (pkt->type == GIT_PKT_ACK) {
if (git_vector_insert(&t->common, pkt) < 0)
return -1;
} else {
if (pkt->type != GIT_PKT_ACK) {
git__free(pkt);
return 0;
}
if (git_vector_insert(&t->common, pkt) < 0) {
git__free(pkt);
return -1;
}
} while (1);
return 0;
......
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