Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stunc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BBF
stunc
Commits
741ef6aa
Verified
Commit
741ef6aa
authored
10 months ago
by
Suvendhu Hansa
Committed by
IOPSYS Dev
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix segfault
parent
7dfe9ae4
No related branches found
No related tags found
1 merge request
!36
Fix crash
Pipeline
#216456
passed
3 weeks ago
Stage: static_code_analysis
Stage: compilation_test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.c
+11
-9
11 additions, 9 deletions
src/main.c
with
11 additions
and
9 deletions
src/main.c
+
11
−
9
View file @
741ef6aa
...
@@ -117,7 +117,6 @@ static int stunc_get_auth_code(char *data, int data_len, const char *key, char *
...
@@ -117,7 +117,6 @@ static int stunc_get_auth_code(char *data, int data_len, const char *key, char *
static
int
stunc_init
(
void
)
static
int
stunc_init
(
void
)
{
{
int
len
;
int
len
;
char
address
[
256
]
=
{
0
};
char
*
val
;
char
*
val
;
stunc_uci_init
();
stunc_uci_init
();
...
@@ -129,7 +128,11 @@ static int stunc_init(void)
...
@@ -129,7 +128,11 @@ static int stunc_init(void)
val
=
stunc_uci_get_value
(
"stunc"
,
"stunc"
,
"server_address"
);
val
=
stunc_uci_get_value
(
"stunc"
,
"stunc"
,
"server_address"
);
if
(
STRLEN
(
val
)
==
0
)
{
if
(
STRLEN
(
val
)
==
0
)
{
char
address
[
256
]
=
{
0
};
SLOG
(
INFO
,
"Server Address not present in the STUN config"
);
SLOG
(
INFO
,
"Server Address not present in the STUN config"
);
FREE
(
val
);
/* Read from ACS address */
/* Read from ACS address */
get_acs_address
(
&
val
);
get_acs_address
(
&
val
);
if
(
val
==
NULL
)
if
(
val
==
NULL
)
...
@@ -166,13 +169,12 @@ get_addr:
...
@@ -166,13 +169,12 @@ get_addr:
snprintf
(
address
,
len
+
1
,
"%s"
,
val
);
snprintf
(
address
,
len
+
1
,
"%s"
,
val
);
free
(
tmp
);
free
(
tmp
);
conf
.
server_address
=
strdup
(
address
);
val
=
address
;
}
else
{
conf
.
server_address
=
strdup
(
val
);
FREE
(
val
);
}
}
conf
.
server_address
=
strdup
(
val
);
FREE
(
val
);
val
=
stunc_uci_get_value
(
"stunc"
,
"stunc"
,
"username"
);
val
=
stunc_uci_get_value
(
"stunc"
,
"stunc"
,
"username"
);
if
(
STRLEN
(
val
))
if
(
STRLEN
(
val
))
conf
.
username
=
strdup
(
val
);
conf
.
username
=
strdup
(
val
);
...
@@ -273,9 +275,9 @@ static int stunc_start(void)
...
@@ -273,9 +275,9 @@ static int stunc_start(void)
static
int
stunc_finish
(
void
)
static
int
stunc_finish
(
void
)
{
{
free
(
conf
.
server_address
);
FREE
(
conf
.
server_address
);
free
(
conf
.
password
);
FREE
(
conf
.
password
);
free
(
conf
.
username
);
FREE
(
conf
.
username
);
conf
.
server_address
=
NULL
;
conf
.
server_address
=
NULL
;
conf
.
username
=
NULL
;
conf
.
username
=
NULL
;
conf
.
password
=
NULL
;
conf
.
password
=
NULL
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment