Revision
4405
Author
lsansonetti@apple.com
Date
2010-08-04 13:53:09 -0700 (Wed, 04 Aug 2010)

Log Message

fixed a crasher in Zlib::Deflate.deflate (apparently introduced since r2347...)

Modified Paths

Diff

Modified: MacRuby/trunk/ext/zlib/zlib.c (4404 => 4405)


--- MacRuby/trunk/ext/zlib/zlib.c	2010-08-04 08:31:33 UTC (rev 4404)
+++ MacRuby/trunk/ext/zlib/zlib.c	2010-08-04 20:53:09 UTC (rev 4405)
@@ -1103,12 +1103,14 @@
 static VALUE
 rb_deflate_s_deflate(VALUE klass, SEL sel, int argc, VALUE *argv)
 {
-    struct zstream *z = (struct zstream*)zstream_deflate_new(klass);
+    struct zstream *z;
     VALUE src, level, dst, args[2];
     int err, lev;
 
     rb_scan_args(argc, argv, "11", &src, &level);
 
+    z = (struct zstream *)xmalloc(sizeof(struct zstream));
+
     lev = ARG_LEVEL(level);
     StringValue(src);
     src = rb_str_bstr(src);