mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 06:20:56 +00:00
Free allocated pointer to curl stream on error
This commit is contained in:
parent
0f9d15493d
commit
8bd1c19e76
@ -207,11 +207,14 @@ int git_curl_stream_new(git_stream **out, const char *host, const char *port)
|
||||
handle = curl_easy_init();
|
||||
if (handle == NULL) {
|
||||
giterr_set(GITERR_NET, "failed to create curl handle");
|
||||
git__free(st);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((error = git__strtol32(&iport, port, NULL, 10)) < 0)
|
||||
if ((error = git__strtol32(&iport, port, NULL, 10)) < 0) {
|
||||
git__free(st);
|
||||
return error;
|
||||
}
|
||||
|
||||
curl_easy_setopt(handle, CURLOPT_URL, host);
|
||||
curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, st->curl_error);
|
||||
|
Loading…
Reference in New Issue
Block a user