New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in Redcarpet::Render::Base #516

Merged
merged 1 commit into from Sep 23, 2015
Jump to file or symbol
Failed to load files and symbols.
+6 −1
Diff settings

Always

Just for now

@@ -375,11 +375,16 @@ static void rb_redcarpet_rbase_mark(struct rb_redcarpet_rndr *rndr)
rb_gc_mark(rndr->options.link_attributes);
}
static void rndr_deallocate(void *rndr)
{
xfree(rndr);
}
static VALUE rb_redcarpet_rbase_alloc(VALUE klass)
{
struct rb_redcarpet_rndr *rndr = ALLOC(struct rb_redcarpet_rndr);
memset(rndr, 0x0, sizeof(struct rb_redcarpet_rndr));
return Data_Wrap_Struct(klass, rb_redcarpet_rbase_mark, NULL, rndr);
return Data_Wrap_Struct(klass, rb_redcarpet_rbase_mark, rndr_deallocate, rndr);
}
static void rb_redcarpet__overload(VALUE self, VALUE base_class)