diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-04-23 21:31:38 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-04-23 21:31:38 +0000 |
commit | a6843f2d1ecf58a3ec2d015f7d379f923fb14528 (patch) | |
tree | c0cba943207eb76407d9784bd8e6a9c95803b695 /apropos_db.c | |
parent | 9a4f79b8ca10cc2f4f3665e85ffc339ecf8b8d7d (diff) | |
download | mandoc-a6843f2d1ecf58a3ec2d015f7d379f923fb14528.tar.gz mandoc-a6843f2d1ecf58a3ec2d015f7d379f923fb14528.tar.zst mandoc-a6843f2d1ecf58a3ec2d015f7d379f923fb14528.zip |
Audit malloc(3)/calloc(3)/realloc(3) in VERSION_1_12.
Diffstat (limited to 'apropos_db.c')
-rw-r--r-- | apropos_db.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apropos_db.c b/apropos_db.c index f96c94f9..2eee2091 100644 --- a/apropos_db.c +++ b/apropos_db.c @@ -1,4 +1,4 @@ -/* $Id: apropos_db.c,v 1.32.2.5 2014/03/23 12:04:54 schwarze Exp $ */ +/* $Id: apropos_db.c,v 1.32.2.6 2014/04/23 21:31:38 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2014 Ingo Schwarze <schwarze@openbsd.org> @@ -555,8 +555,8 @@ single_search(struct rectree *tree, const struct opts *opts, if (strcasecmp(opts->arch, r.arch)) continue; - tree->node = rs = mandoc_realloc - (rs, (tree->len + 1) * sizeof(struct res)); + tree->node = rs = mandoc_reallocarray(rs, + tree->len + 1, sizeof(struct res)); memcpy(&rs[tree->len], &r, sizeof(struct res)); memset(&r, 0, sizeof(struct res)); |