mirror of
https://git.proxmox.com/git/libgit2
synced 2025-10-18 00:33:13 +00:00
Remove double-free segfaults
This commit is contained in:
parent
016179d668
commit
8c36a3cdba
@ -179,7 +179,7 @@ static int _git_uploadpack_ls(
|
|||||||
const char *url,
|
const char *url,
|
||||||
git_smart_subtransport_stream **stream)
|
git_smart_subtransport_stream **stream)
|
||||||
{
|
{
|
||||||
char *host, *port, *user, *pass;
|
char *host, *port, *user=NULL, *pass=NULL;
|
||||||
git_stream *s;
|
git_stream *s;
|
||||||
|
|
||||||
*stream = NULL;
|
*stream = NULL;
|
||||||
@ -201,8 +201,8 @@ static int _git_uploadpack_ls(
|
|||||||
t->current_stream = s;
|
t->current_stream = s;
|
||||||
git__free(host);
|
git__free(host);
|
||||||
git__free(port);
|
git__free(port);
|
||||||
git__free(user);
|
if (user) git__free(user);
|
||||||
git__free(pass);
|
if (pass) git__free(pass);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
@ -235,7 +235,7 @@ static int _git_receivepack_ls(
|
|||||||
const char *url,
|
const char *url,
|
||||||
git_smart_subtransport_stream **stream)
|
git_smart_subtransport_stream **stream)
|
||||||
{
|
{
|
||||||
char *host, *port, *user, *pass;
|
char *host, *port, *user=NULL, *pass=NULL;
|
||||||
git_stream *s;
|
git_stream *s;
|
||||||
|
|
||||||
*stream = NULL;
|
*stream = NULL;
|
||||||
@ -257,8 +257,8 @@ static int _git_receivepack_ls(
|
|||||||
t->current_stream = s;
|
t->current_stream = s;
|
||||||
git__free(host);
|
git__free(host);
|
||||||
git__free(port);
|
git__free(port);
|
||||||
git__free(user);
|
if (user) git__free(user);
|
||||||
git__free(pass);
|
if (pass) git__free(pass);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
|
Loading…
Reference in New Issue
Block a user