Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed to crash #9

Merged
merged 1 commit into from

2 participants

@masuidrive

No description provided.

@mattn mattn merged commit 0d73194 into from
@mattn
Owner

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2013
  1. @masuidrive

    Fixed to crash

    masuidrive authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/mrb_http.c
View
6 src/mrb_http.c
@@ -320,7 +320,7 @@ 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);
@@ -328,7 +328,9 @@ mrb_http_parser_parse_url(mrb_state *mrb, mrb_value self)
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)) {
Something went wrong with that request. Please try again.