Commit 8a62bf11 by Patrick Steinhardt

netops: fix memory leak when an error occurs

parent b0f7512f
......@@ -261,6 +261,10 @@ int gitno_extract_url_parts(
*path = git__substrdup(_path, u.field_data[UF_PATH].len);
GITERR_CHECK_ALLOC(*path);
} else {
git__free(*port);
*port = NULL;
git__free(*host);
*host = NULL;
giterr_set(GITERR_NET, "invalid url, missing path");
return GIT_EINVALIDSPEC;
}
......
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