nghttpx: Allocate mruby file because fopen requires NULL terminated string

This commit is contained in:
Tatsuhiro Tsujikawa 2018-08-24 23:08:15 +09:00
parent 0ccc7a770d
commit fb97f596e1
1 changed files with 2 additions and 2 deletions

View File

@ -1057,7 +1057,7 @@ int parse_mapping(Config *config, DownstreamAddrConfig &addr,
// least one backend with mruby file, it is used for all backend
// in the group.
if (g.mruby_file.empty()) {
g.mruby_file = params.mruby;
g.mruby_file = make_string_ref(downstreamconf.balloc, params.mruby);
} else if (g.mruby_file != params.mruby) {
LOG(ERROR) << "backend: mruby: multiple different mruby file found in "
"a single group";
@ -1084,7 +1084,7 @@ int parse_mapping(Config *config, DownstreamAddrConfig &addr,
g.affinity.cookie.secure = params.affinity.cookie.secure;
}
g.redirect_if_not_tls = params.redirect_if_not_tls;
g.mruby_file = params.mruby;
g.mruby_file = make_string_ref(downstreamconf.balloc, params.mruby);
if (pattern[0] == '*') {
// wildcard pattern