summaryrefslogtreecommitdiffstats
path: root/usr.bin/file/magic.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/file/magic.c')
-rw-r--r--usr.bin/file/magic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/file/magic.c b/usr.bin/file/magic.c
index f2fd3bb179e..6640ed5cad4 100644
--- a/usr.bin/file/magic.c
+++ b/usr.bin/file/magic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: magic.c,v 1.3 2007/07/09 16:39:48 dim Exp $ */
+/* $OpenBSD: magic.c,v 1.4 2007/09/02 15:19:32 deraadt Exp $ */
/*
* Copyright (c) Christos Zoulas 2003.
* All Rights Reserved.
@@ -66,7 +66,7 @@
#include "patchlevel.h"
#ifndef lint
-FILE_RCSID("@(#)$Id: magic.c,v 1.3 2007/07/09 16:39:48 dim Exp $")
+FILE_RCSID("@(#)$Id: magic.c,v 1.4 2007/09/02 15:19:32 deraadt Exp $")
#endif /* lint */
#ifdef __EMX__
@@ -104,7 +104,8 @@ magic_open(int flags)
free(ms);
return NULL;
}
- ms->c.off = malloc((ms->c.len = 10) * sizeof(*ms->c.off));
+ ms->c.len = 10;
+ ms->c.off = calloc(ms->c.len, sizeof(*ms->c.off));
if (ms->c.off == NULL) {
free(ms->o.pbuf);
free(ms->o.buf);