Missing malloc check.
This commit is contained in:
parent
ce7f60e45f
commit
55f4a17a69
@ -924,6 +924,10 @@ static int mosquitto__parse_socks_url(struct mosq_config *cfg, char *url)
|
||||
port[len] = '\0';
|
||||
}else{
|
||||
host = malloc(len + 1);
|
||||
if(!host){
|
||||
fprintf(stderr, "Error: Out of memory.\n");
|
||||
goto cleanup;
|
||||
}
|
||||
memcpy(host, &(str[start]), len);
|
||||
host[len] = '\0';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user