Fix Coverity error CID 56880

Signed-off-by: Gregor Jasny <gja...@googlemail.com>
---
 ares_options.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ares_options.c b/ares_options.c
index 76d82df..cf88433 100644
--- a/ares_options.c
+++ b/ares_options.c
@@ -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] = ',';
-- 
1.8.5.2 (Apple Git-48)

Reply via email to