Index: videotest.c
===================================================================
RCS file: /cvs/src/regress/sys/dev/video/videotest.c,v
retrieving revision 1.3
diff -u -p -r1.3 videotest.c
--- videotest.c 22 Jul 2010 11:58:03 -0000      1.3
+++ videotest.c 25 May 2014 08:30:04 -0000
@@ -356,16 +356,14 @@ test_capture(char *dev_name, char *dev_f
                        }
 
                        buf_size = fmt.fmt.pix.sizeimage;
-                       buf = malloc(buf_size);
+                       buf = calloc(1, buf_size);
                        if (buf == NULL)
                                goto error;
-                       memset(buf, 0, buf_size);
 
                        img_size = fmt.fmt.pix.sizeimage + 1024;
-                       img = malloc(img_size);
+                       img = calloc(1, img_size);
                        if (img == NULL)
                                goto error;
-                       memset(img, 0, img_size);
 
                        /* get frame */
                        if (access == ACCESS_READ)

Reply via email to