From 2ee578d80034d8c636ebc1b242942865eb338f4f Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 12 Feb 2013 13:54:18 +0000 Subject: [PATCH] ptserver: Use correct structure type in malloc prentries is a list of 'struct prlistentries' objects, not a list of 'struct prentry'. Use the correct type in our call to malloc. Caught by clang analyzer Change-Id: I6c36e4b875eafb8aff6506cf800d47b45a79825d Reviewed-on: http://gerrit.openafs.org/9150 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/ptserver/ptprocs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index cf31d7697..776a67b4f 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -1479,7 +1479,7 @@ put_prentries(struct prentry *tentry, prentries *bulkentries) if (bulkentries->prentries_val == 0) { bulkentries->prentries_len = 0; bulkentries->prentries_val = malloc(PR_MAXENTRIES * - sizeof(struct prentry)); + sizeof(struct prlistentries)); if (!bulkentries->prentries_val) { return (PRNOMEM); } @@ -1489,7 +1489,7 @@ put_prentries(struct prentry *tentry, prentries *bulkentries) return (-1); } - entry = (struct prlistentries *)bulkentries->prentries_val; + entry = bulkentries->prentries_val; entry += bulkentries->prentries_len; entry->flags = tentry->flags >> PRIVATE_SHIFT; -- 2.39.5