mirror of
https://git.proxmox.com/git/libgit2
synced 2025-10-19 16:42:30 +00:00
netops: fix memory leak when an error occurs
This commit is contained in:
parent
b0f7512f40
commit
8a62bf1180
@ -261,6 +261,10 @@ int gitno_extract_url_parts(
|
|||||||
*path = git__substrdup(_path, u.field_data[UF_PATH].len);
|
*path = git__substrdup(_path, u.field_data[UF_PATH].len);
|
||||||
GITERR_CHECK_ALLOC(*path);
|
GITERR_CHECK_ALLOC(*path);
|
||||||
} else {
|
} else {
|
||||||
|
git__free(*port);
|
||||||
|
*port = NULL;
|
||||||
|
git__free(*host);
|
||||||
|
*host = NULL;
|
||||||
giterr_set(GITERR_NET, "invalid url, missing path");
|
giterr_set(GITERR_NET, "invalid url, missing path");
|
||||||
return GIT_EINVALIDSPEC;
|
return GIT_EINVALIDSPEC;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user