Skip to content
Browse files

Merge pull request #9 from masuidrive/fixed_to_crash

Fixed to crash
  • Loading branch information...
2 parents 57311df + c4c2d12 commit 0d73194ca3acbf11620106053f1d2210726ae019 @mattn committed Mar 31, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/mrb_http.c
View
6 src/mrb_http.c
@@ -320,15 +320,17 @@ mrb_http_parser_parse_url(mrb_state *mrb, mrb_value self)
mrb_value c;
mrb_value arg_data;
struct http_parser_url handle = {0};
- struct RClass* _class_http_url;
+ struct RClass* _class_http, *_class_http_url;
mrb_get_args(mrb, "S", &arg_data);
if (http_parser_parse_url(RSTRING_PTR(arg_data), RSTRING_LEN(arg_data), FALSE, &handle)) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "invalid URL");
}
- _class_http_url = mrb_class_get(mrb, "HTTP");
+ _class_http = mrb_class_get(mrb, "HTTP");
+ _class_http_url = mrb_class_ptr(mrb_const_get(mrb, mrb_obj_value(_class_http), mrb_intern(mrb, "URL")));
+
c = mrb_class_new_instance(mrb, 0, NULL, _class_http_url);
if (handle.field_set & (1<<UF_SCHEMA)) {

0 comments on commit 0d73194

Please sign in to comment.
Something went wrong with that request. Please try again.