diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-29 16:35:47 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-29 16:35:47 +0000 |
commit | bf54356c9efa4f3aba3c6b626d1712e6d9537264 (patch) | |
tree | be93b35904cf90f65809260885ec051ad5e7ea68 /regress | |
parent | e0f684d0892cd8e32ce2d019c3fb71b6805bd38f (diff) |
use calloc, from Benjamin Baier
Diffstat (limited to 'regress')
-rw-r--r-- | regress/sys/dev/video/videotest.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/regress/sys/dev/video/videotest.c b/regress/sys/dev/video/videotest.c index f255f6def59..f141f1923f5 100644 --- a/regress/sys/dev/video/videotest.c +++ b/regress/sys/dev/video/videotest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: videotest.c,v 1.3 2010/07/22 11:58:03 mglocker Exp $ */ +/* $OpenBSD: videotest.c,v 1.4 2014/05/29 16:35:46 tedu Exp $ */ /* * Copyright (c) 2010 Marcus Glocker <mglocker@openbsd.org> @@ -356,16 +356,14 @@ test_capture(char *dev_name, char *dev_full, int access, int use_poll) } 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) |