Fix type mismatches for malloc(3) and Co.
Found by: clang static analyzer Reviewed by: ed Differential Revision: https://reviews.freebsd.org/D4722
This commit is contained in:
parent
fcf8d36c46
commit
e96092e82b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292863
@ -541,7 +541,7 @@ append_arg(struct cpa *sa, char *arg)
|
|||||||
{
|
{
|
||||||
if (sa->c + 1 == sa->sz) {
|
if (sa->c + 1 == sa->sz) {
|
||||||
sa->sz = sa->sz == 0 ? 8 : sa->sz * 2;
|
sa->sz = sa->sz == 0 ? 8 : sa->sz * 2;
|
||||||
sa->a = realloc(sa->a, sizeof(sa->a) * sa->sz);
|
sa->a = realloc(sa->a, sizeof(*sa->a) * sa->sz);
|
||||||
if (sa->a == NULL)
|
if (sa->a == NULL)
|
||||||
errx(1, "realloc failed");
|
errx(1, "realloc failed");
|
||||||
}
|
}
|
||||||
|
@ -434,7 +434,7 @@ getmntentry(const char *fromname, const char *onname, fsid_t *fsid, dowhat what)
|
|||||||
{
|
{
|
||||||
static struct statfs *mntbuf;
|
static struct statfs *mntbuf;
|
||||||
static size_t mntsize = 0;
|
static size_t mntsize = 0;
|
||||||
static char *mntcheck = NULL;
|
static int *mntcheck = NULL;
|
||||||
struct statfs *sfs, *foundsfs;
|
struct statfs *sfs, *foundsfs;
|
||||||
int i, count;
|
int i, count;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user