Skip to content

Commit

Permalink
Call curl_global_cleanup on error from curl_init
Browse files Browse the repository at this point in the history
  • Loading branch information
f2404 committed May 19, 2016
1 parent 7a1869c commit 9bee309
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion src/alpm-query.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ static bool alpm_pkg_get_outofdate (alpm_pkg_t *pkg)
{
CURL *curl = curl_init (CURL_GLOBAL_SSL);
if (!curl) {
curl_global_cleanup ();
return false;
}

Expand Down
3 changes: 0 additions & 3 deletions src/aur.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,7 @@ unsigned int aur_request (alpm_list_t **targets, aurrequest_t type)

CURL *curl = (strncmp (config.aur_url, "https", strlen ("https")) == 0) ?
curl_init (CURL_GLOBAL_SSL) : curl_init (CURL_GLOBAL_NOTHING);

if (!curl) {
curl_global_cleanup ();
return 0;
}

Expand Down Expand Up @@ -817,7 +815,6 @@ static char *aur_get_arch (const aurpkg_t *pkg)

CURL *curl = curl_init (CURL_GLOBAL_SSL);
if (!curl) {
curl_global_cleanup ();
return NULL;
}

Expand Down
1 change: 1 addition & 0 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,7 @@ CURL *curl_init (long flags)
CURL *curl = curl_easy_init ();
if (!curl) {
perror ("curl easy");
curl_global_cleanup ();
return NULL;
}

Expand Down

0 comments on commit 9bee309

Please sign in to comment.