lib/re: fix invalid malloc
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 23 Sep 2014 19:23:47 +0000 (15:23 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 23 Sep 2014 19:23:47 +0000 (15:23 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/standard/re.nit

index 7baabd2..97cb7cb 100644 (file)
@@ -180,7 +180,7 @@ class Regex
        private var native: nullable NativeRegex = null
 
        # Cache of a single `regmatch_t` to prevent many calls to `malloc`
-       private var native_match = new NativeMatchArray.malloc(0) is lazy
+       private var native_match = new NativeMatchArray.malloc(1) is lazy
 
        # `cflags` of the last successful `compile`
        private var cflags_cache = 0