Skip to content
Snippets Groups Projects
Commit 38f421b3 authored by Julian Rother's avatar Julian Rother
Browse files

Fixed use after free in api error handling

parent 376edfcf
No related branches found
No related tags found
No related merge requests found
...@@ -49,13 +49,13 @@ int ping_job(int id, char *state, char *status, ...) ...@@ -49,13 +49,13 @@ int ping_job(int id, char *state, char *status, ...)
curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_URL, url);
ret = curl_easy_perform(curl); ret = curl_easy_perform(curl);
free(p); free(p);
free(url);
curl_easy_cleanup(curl); curl_easy_cleanup(curl);
if (ret) if (ret)
{ {
fprintf(stderr, "API call to \"%s\" failed: %s\n", url, curl_easy_strerror(ret)); fprintf(stderr, "API call to \"%s\" failed: %s\n", url, curl_easy_strerror(ret));
free(url);
return -1; return -1;
} }
else free(url);
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment