Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast-Server
Commits
a301a302
Commit
a301a302
authored
Jan 09, 2019
by
Philipp Schafft
🦁
Browse files
Feature: Replaced free()-strdup() in event code with util_replace_string()
See:
#2370
parent
edd3dcc6
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/event_exec.c
View file @
a301a302
...
...
@@ -275,10 +275,7 @@ int event_get_exec(event_registration_t *er, config_options_t *options) {
* <option name="default_arguments" value="..." /> (for values see near top of documment)
*/
if
(
strcmp
(
cur
->
name
,
"executable"
)
==
0
)
{
free
(
self
->
executable
);
self
->
executable
=
NULL
;
if
(
cur
->
value
)
self
->
executable
=
strdup
(
cur
->
value
);
util_replace_string
(
&
(
self
->
executable
),
cur
->
value
);
}
else
if
(
strcmp
(
cur
->
name
,
"default_arguments"
)
==
0
)
{
self
->
argvtype
=
__str2argvtype
(
cur
->
value
);
}
else
{
...
...
src/event_log.c
View file @
a301a302
...
...
@@ -64,10 +64,7 @@ int event_get_log(event_registration_t *er, config_options_t *options) {
* <option name="level" value="..." />
*/
if
(
strcmp
(
options
->
name
,
"prefix"
)
==
0
)
{
free
(
self
->
prefix
);
self
->
prefix
=
NULL
;
if
(
options
->
value
)
self
->
prefix
=
strdup
(
options
->
value
);
util_replace_string
(
&
(
self
->
prefix
),
options
->
value
);
}
else
if
(
strcmp
(
options
->
name
,
"level"
)
==
0
)
{
self
->
level
=
ICECAST_LOGLEVEL_INFO
;
if
(
options
->
value
)
...
...
src/event_url.c
View file @
a301a302
...
...
@@ -122,19 +122,13 @@ int event_get_url(event_registration_t *er, config_options_t *options) {
* <option name="action" value="..." />
*/
if
(
strcmp
(
options
->
name
,
"url"
)
==
0
)
{
free
(
self
->
url
);
self
->
url
=
NULL
;
if
(
options
->
value
)
self
->
url
=
strdup
(
options
->
value
);
util_replace_string
(
&
(
self
->
url
),
options
->
value
);
}
else
if
(
strcmp
(
options
->
name
,
"username"
)
==
0
)
{
username
=
options
->
value
;
}
else
if
(
strcmp
(
options
->
name
,
"password"
)
==
0
)
{
password
=
options
->
value
;
}
else
if
(
strcmp
(
options
->
name
,
"action"
)
==
0
)
{
free
(
self
->
action
);
self
->
action
=
NULL
;
if
(
options
->
value
)
self
->
action
=
strdup
(
options
->
value
);
util_replace_string
(
&
(
self
->
action
),
options
->
value
);
}
else
{
ICECAST_LOG_ERROR
(
"Unknown <option> tag with name %s."
,
options
->
name
);
}
...
...
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