Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
canghaiwuhen
OpenXG-RAN
Commits
4a3f26b2
Commit
4a3f26b2
authored
Jun 20, 2019
by
Dong Anyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Coverity Scan CID 340228 (Handle variable s going out of scope leaks the handle.)
parent
f6765e06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
openair2/UTIL/ASYNC_IF/socket_link.c
openair2/UTIL/ASYNC_IF/socket_link.c
+6
-2
No files found.
openair2/UTIL/ASYNC_IF/socket_link.c
View file @
4a3f26b2
...
@@ -218,6 +218,7 @@ error:
...
@@ -218,6 +218,7 @@ error:
socket_link_t
*
new_link_udp_client
(
const
char
*
server
,
int
port
){
socket_link_t
*
new_link_udp_client
(
const
char
*
server
,
int
port
){
int
s
=
-
1
;
socket_link_t
*
ret
=
NULL
;
socket_link_t
*
ret
=
NULL
;
ret
=
calloc
(
1
,
sizeof
(
socket_link_t
));
ret
=
calloc
(
1
,
sizeof
(
socket_link_t
));
if
(
ret
==
NULL
)
{
if
(
ret
==
NULL
)
{
...
@@ -227,7 +228,6 @@ socket_link_t *new_link_udp_client(const char *server, int port){
...
@@ -227,7 +228,6 @@ socket_link_t *new_link_udp_client(const char *server, int port){
ret
->
socket_fd
=
-
1
;
ret
->
socket_fd
=
-
1
;
struct
sockaddr_in
si_other
;
struct
sockaddr_in
si_other
;
int
s
;
socklen_t
slen
=
sizeof
(
si_other
);
socklen_t
slen
=
sizeof
(
si_other
);
if
(
(
s
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
))
==
-
1
){
if
(
(
s
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
))
==
-
1
){
...
@@ -254,8 +254,12 @@ socket_link_t *new_link_udp_client(const char *server, int port){
...
@@ -254,8 +254,12 @@ socket_link_t *new_link_udp_client(const char *server, int port){
return
ret
;
return
ret
;
error:
error:
if
(
ret
!=
NULL
)
{
if
(
ret
!=
NULL
)
{
close
(
ret
->
socket_fd
);
free
(
ret
);
free
(
ret
);
ret
=
NULL
;
}
if
(
s
!=
-
1
)
{
close
(
s
);
s
=
-
1
;
}
}
LOG_E
(
MAC
,
"ERROR in new_link_udp_client (see above), returning NULL
\n
"
);
LOG_E
(
MAC
,
"ERROR in new_link_udp_client (see above), returning NULL
\n
"
);
return
NULL
;
return
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment