nghttpx: Return copied string for safety

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-02 21:14:49 +09:00
parent 9d78691936
commit 2170d958d5
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ mrb_value request_get_path(mrb_state *mrb, mrb_value self) {
auto downstream = static_cast<Downstream *>(mrb->ud);
auto &path = downstream->get_request_path();
return mrb_str_new_static(mrb, path.c_str(), path.size());
return mrb_str_new(mrb, path.c_str(), path.size());
}
} // namespace
@ -101,7 +101,7 @@ mrb_value request_headers_get(mrb_state *mrb, mrb_value self) {
return mrb_nil_value();
}
return mrb_str_new_static(mrb, hd->value.c_str(), hd->value.size());
return mrb_str_new(mrb, hd->value.c_str(), hd->value.size());
}
} // namespace