Commit 1b976e9a authored by Pekka Pessi's avatar Pekka Pessi

s2dns.c: add check for su_socket return value

MeeGo Coverity issue CID#11744
parent b3771d7e
/* ---------------------------------------------------------------------- */
/* S2 DNS server */
#include "config.h"
#include <sofia-sip/sresolv.h>
#include <sofia-resolv/sres_record.h>
#include <sofia-sip/url.h>
......@@ -9,6 +11,8 @@
#include <string.h>
#include <stdlib.h>
#undef NDEBUG
#include <assert.h>
extern uint16_t _sres_default_port; /* Ugly hack */
......@@ -82,6 +86,7 @@ void s2_dns_setup(su_root_t *root)
/* su->su_port = htons(1053); */
socket = su_socket(su->su_family, SOCK_DGRAM, 0);
assert(socket != -1);
n = bind(socket, &su->su_sa, sulen); assert(n == 0);
n = getsockname(socket, &su->su_sa, &sulen); assert(n == 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment