aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2006-06-21 09:28:00 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2006-06-21 09:28:00 +0000
commitdbca37326fc67da021d06cc2d5cee76ef2ee1339 (patch)
tree31871e9e619ab622a6af7fcfe294c89a1e259a91
parent88a5e5ac7bd10f7a3c0e20dc7e6264019eef0006 (diff)
downloadsrc-dbca37326fc67da021d06cc2d5cee76ef2ee1339.tar.gz
src-dbca37326fc67da021d06cc2d5cee76ef2ee1339.zip
Fix segfault when '/etc/malloc.conf@ -> AJ' due to differnce between
calloc & malloc as agreed by vendor. Also remove an unused variable.
Notes
Notes: svn path=/vendor/file/dist/; revision=159825
-rw-r--r--contrib/file/apprentice.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/file/apprentice.c b/contrib/file/apprentice.c
index 4432a569deee..a5bc4f205ef9 100644
--- a/contrib/file/apprentice.c
+++ b/contrib/file/apprentice.c
@@ -380,8 +380,8 @@ apprentice_file(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
return -1;
}
- maxmagic = MAXMAGIS;
- if ((marray = malloc(maxmagic * sizeof(*marray))) == NULL) {
+ maxmagic = MAXMAGIS;
+ if ((marray = calloc(maxmagic, sizeof(*marray))) == NULL) {
(void)fclose(f);
file_oomem(ms);
return -1;
@@ -509,7 +509,7 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
char *t;
private const char *fops = FILE_OPS;
uint32_t val;
- uint32_t cont_level, cont_count;
+ uint32_t cont_level;
cont_level = 0;