mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2025-10-06 10:19:48 +00:00
Null check before dereference
Fix Coverity error CID 56880 Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
This commit is contained in:
committed by
David Drysdale
parent
880ec44da9
commit
13dc4800b2
@ -158,6 +158,9 @@ int ares_set_servers_csv(ares_channel channel,
|
||||
return ARES_SUCCESS; /* blank all servers */
|
||||
|
||||
csv = malloc(i + 2);
|
||||
if (!csv)
|
||||
return ARES_ENOMEM;
|
||||
|
||||
strcpy(csv, _csv);
|
||||
if (csv[i-1] != ',') { /* make parsing easier by ensuring ending ',' */
|
||||
csv[i] = ',';
|
||||
|
Reference in New Issue
Block a user