Commit e7294e87 by yuangli

fix memory leaks about packets

parent 179aac78
...@@ -694,6 +694,8 @@ int git_pkt_buffer_wants( ...@@ -694,6 +694,8 @@ int git_pkt_buffer_wants(
git_str_printf(&deepen_buf, "deepen %d\n", wants->depth); git_str_printf(&deepen_buf, "deepen %d\n", wants->depth);
git_str_printf(buf,"%04x%s", (unsigned int)git_str_len(&deepen_buf) + 4, git_str_cstr(&deepen_buf)); git_str_printf(buf,"%04x%s", (unsigned int)git_str_len(&deepen_buf) + 4, git_str_cstr(&deepen_buf));
git_str_dispose(&deepen_buf);
if (git_str_oom(buf)) if (git_str_oom(buf))
return -1; return -1;
} }
......
...@@ -385,8 +385,12 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c ...@@ -385,8 +385,12 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
git_error_set(GIT_ERROR_NET, "Unexpected pkt type"); git_error_set(GIT_ERROR_NET, "Unexpected pkt type");
goto on_error; goto on_error;
} }
git_pkt_free((git_pkt *) pkt);
} }
git_pkt_free((git_pkt *) pkt);
if (error < 0) { if (error < 0) {
goto on_error; goto on_error;
} }
......
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