Ensure that memory is zero-initialised.
authorDavid Given <dg@cowlark.com>
Mon, 16 Jan 2017 21:45:03 +0000 (22:45 +0100)
committerDavid Given <dg@cowlark.com>
Mon, 16 Jan 2017 21:45:03 +0000 (22:45 +0100)
mach/proto/ncg/salloc.c

index e110d75..7ce1287 100644 (file)
@@ -37,7 +37,7 @@ void chkstr();
 string myalloc(size) {
        register string p;
 
-       p = (string) malloc((unsigned)size);
+       p = (string) calloc((unsigned)size, 1);
        if (p==0)
                fatal("Out of memory");
        return(p);