http2:set_transfer_url() return early on OOM
If curl_url() returns NULL this should return early to avoid mistakes - even if right now the subsequent function invokes are all OK. Coverity (wrongly) pointed out this as a NULL deref. Closes #8100
This commit is contained in:
Родитель
bc064a8177
Коммит
b3f9c1aa09
|
@ -505,10 +505,13 @@ static int set_transfer_url(struct Curl_easy *data,
|
||||||
struct curl_pushheaders *hp)
|
struct curl_pushheaders *hp)
|
||||||
{
|
{
|
||||||
const char *v;
|
const char *v;
|
||||||
CURLU *u = curl_url();
|
|
||||||
CURLUcode uc;
|
CURLUcode uc;
|
||||||
char *url = NULL;
|
char *url = NULL;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
CURLU *u = curl_url();
|
||||||
|
|
||||||
|
if(!u)
|
||||||
|
return 5;
|
||||||
|
|
||||||
v = curl_pushheader_byname(hp, ":scheme");
|
v = curl_pushheader_byname(hp, ":scheme");
|
||||||
if(v) {
|
if(v) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче