diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-08-03 19:09:19 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2019-08-03 19:31:14 -0700 |
commit | f54470dab5b392380df61a22b4b4bef685b6cee2 (patch) | |
tree | 561d2a367f295f3fe53f72712b3b3f3d1011ec18 /src/fontfile/catalogue.c | |
parent | 27207d35d4b4bbd5d2b2c5f7e13a61ea43d04a4a (diff) |
Convert multiplying realloc calls to use reallocarray instead
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/fontfile/catalogue.c')
-rw-r--r-- | src/fontfile/catalogue.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fontfile/catalogue.c b/src/fontfile/catalogue.c index 2087232..5df01c2 100644 --- a/src/fontfile/catalogue.c +++ b/src/fontfile/catalogue.c @@ -35,6 +35,7 @@ #include <sys/stat.h> #include <dirent.h> #include <unistd.h> +#include "src/util/replace.h" static const char CataloguePrefix[] = "catalogue:"; @@ -64,7 +65,8 @@ CatalogueAddFPE (CataloguePtr cat, FontPathElementPtr fpe) else cat->fpeAlloc *= 2; - new = realloc(cat->fpeList, cat->fpeAlloc * sizeof(FontPathElementPtr)); + new = reallocarray(cat->fpeList, cat->fpeAlloc, + sizeof(FontPathElementPtr)); if (new == NULL) return AllocError; |