Missing malloc check.

This commit is contained in:
Roger A. Light 2017-02-20 21:48:25 +00:00
parent ce7f60e45f
commit 55f4a17a69

View File

@ -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';
}