diff options
author | Clément Bœsch <clement.boesch@smartjog.com> | 2012-11-15 17:11:04 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-03-13 07:25:16 +0100 |
commit | 19c41c6d8ef6cc34cfde6bf877e059689e763bb7 (patch) | |
tree | a3b06db50a8749b5e8acbefb79bb80fa7445c188 /ffserver.c | |
parent | 12fe78a77bf5c2f7e31dcdd0fa4c40d8dc11c762 (diff) | |
download | ffmpeg-19c41c6d8ef6cc34cfde6bf877e059689e763bb7.tar.gz |
opt: re-enable memleak fix for duplicated options.
The memleak fix in a1bcc76e was causing problems when the original
string wasn't NULL or av_malloc'ed, thus was disabled. It seems the only
OPT_STRING occurence where it needed to be fixed is in ffserver. This
commit fixes that specific problem and so re-enable the original code.
Diffstat (limited to 'ffserver.c')
-rw-r--r-- | ffserver.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ffserver.c b/ffserver.c index 1a9f13c734..8acd59173b 100644 --- a/ffserver.c +++ b/ffserver.c @@ -308,7 +308,7 @@ static int rtp_new_av_stream(HTTPContext *c, static const char *my_program_name; -static const char *config_filename = "/etc/ffserver.conf"; +static const char *config_filename; static int ffserver_debug; static int no_launch; @@ -4716,6 +4716,9 @@ int main(int argc, char **argv) parse_options(NULL, argc, argv, options, NULL); + if (!config_filename) + config_filename = av_strdup("/etc/ffserver.conf"); + unsetenv("http_proxy"); /* Kill the http_proxy */ av_lfg_init(&random_state, av_get_random_seed()); @@ -4728,6 +4731,7 @@ int main(int argc, char **argv) fprintf(stderr, "Incorrect config file - exiting.\n"); exit(1); } + av_freep(&config_filename); /* open log file if needed */ if (logfilename[0] != '\0') { |