Merge pull request #11659 from yuwata/fix-11643
import: fix invalid error check and use after free
This commit is contained in:
@@ -291,7 +291,7 @@ int curl_glue_make(CURL **ret, const char *url, void *userdata) {
|
||||
if (curl_easy_setopt(c, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK)
|
||||
return -EIO;
|
||||
|
||||
*ret = c;
|
||||
*ret = TAKE_PTR(c);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -537,7 +537,7 @@ int pull_job_new(PullJob **ret, const char *url, CurlGlue *glue, void *userdata)
|
||||
assert(ret);
|
||||
|
||||
u = strdup(url);
|
||||
if (u)
|
||||
if (!u)
|
||||
return -ENOMEM;
|
||||
|
||||
j = new(PullJob, 1);
|
||||
|
||||
Reference in New Issue
Block a user