Fix CID 1347319 Unchecked return value
authorVolker Lendecke <vl@samba.org>
Thu, 7 Jan 2016 20:14:05 +0000 (21:14 +0100)
committerMartin Schwenke <martin@meltin.net>
Wed, 24 Feb 2016 10:44:28 +0000 (21:44 +1100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(Imported from commit 0cb8b9d113b322f784100365669d2be8b7fa635a)

common/system_linux.c

index 79d1a83ff1023880b6f23fd9667210252d473082..3bc04ba86426c56ae98c31b8340dcac67023c179 100644 (file)
@@ -240,7 +240,13 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
                ip6->ip6_hlim = 255;
                ip6->ip6_src  = addr->ip6.sin6_addr;
                /* all-nodes multicast */
-               inet_pton(AF_INET6, "ff02::1", &ip6->ip6_dst);
+
+               ret = inet_pton(AF_INET6, "ff02::1", &ip6->ip6_dst);
+               if (ret != 1) {
+                       close(s);
+                       DEBUG(DEBUG_CRIT,(__location__ " failed inet_pton\n"));
+                       return -1;
+               }
 
                nd_na = (struct nd_neighbor_advert *)(ip6+1);
                nd_na->nd_na_type = ND_NEIGHBOR_ADVERT;