fix NULL deref: sua_accept_cb: missing error-return
When server creation failed, besides closing the fd also return an error, instead of continuing to use the NULL srv. Change-Id: Iabfae7e5a880d10e4050da4945200ce9b848e577 Fixes: coverity CID#57684
This commit is contained in:
parent
8fab8413bf
commit
26bcc0b9c4
|
@ -1261,8 +1261,10 @@ static int sua_accept_cb(struct osmo_stream_srv_link *link, int fd)
|
|||
srv = osmo_stream_srv_create(user, link, fd,
|
||||
sua_srv_conn_cb,
|
||||
sua_srv_conn_closed_cb, NULL);
|
||||
if (!srv)
|
||||
if (!srv) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* create new SUA link and connect both data structures */
|
||||
sual = sua_link_new(user, 1);
|
||||
|
|
Loading…
Reference in New Issue