mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
ipa-proxy: Socket creation can fail, address coverity issue
Fixes: Coverity CID 1040722
This commit is contained in:
@@ -1005,6 +1005,13 @@ static struct ipa_proxy_conn *connect_bsc(struct sockaddr_in *sa, int priv_nr, v
|
|||||||
bfd->data = ipc;
|
bfd->data = ipc;
|
||||||
bfd->priv_nr = priv_nr;
|
bfd->priv_nr = priv_nr;
|
||||||
|
|
||||||
|
if (bfd->fd < 0) {
|
||||||
|
LOGP(DLINP, LOGL_ERROR, "Could not create socket: %s\n",
|
||||||
|
strerror(errno));
|
||||||
|
talloc_free(ipc);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
||||||
|
|
||||||
ret = connect(bfd->fd, (struct sockaddr *) sa, sizeof(*sa));
|
ret = connect(bfd->fd, (struct sockaddr *) sa, sizeof(*sa));
|
||||||
|
Reference in New Issue
Block a user