From 0f46f6b333b92e66ad987778f5084e3620cff30a Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 12 Feb 2013 13:12:47 +0000 Subject: [PATCH] ptserver: Simplify malloc assignment to shut up clang Using a temporary variable of type (char *) to store the results of malloc and realloc, and then casting the tmp variable to the real type causes clang-analyzer to complain. Just simplify this code by always using the real type in order to shut it up. Change-Id: I607bb36d1899dc617fdbd9e09e18ff10c9fa9ce9 Reviewed-on: http://gerrit.openafs.org/9148 Reviewed-by: Marc Dionne Reviewed-by: Derrick Brashear Tested-by: BuildBot --- src/ptserver/ptutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ptserver/ptutils.c b/src/ptserver/ptutils.c index 5a1b740b5..144d07af3 100644 --- a/src/ptserver/ptutils.c +++ b/src/ptserver/ptutils.c @@ -1204,7 +1204,7 @@ AddToSGEntry(struct ubik_trans *tt, struct prentry *entry, afs_int32 loc, afs_in afs_int32 AddToPRList(prlist *alist, int *sizeP, afs_int32 id) { - char *tmp; + afs_int32 *tmp; int count; if (alist->prlist_len >= *sizeP) { @@ -1216,7 +1216,7 @@ AddToPRList(prlist *alist, int *sizeP, afs_int32 id) } if (!tmp) return (PRNOMEM); - alist->prlist_val = (afs_int32 *) tmp; + alist->prlist_val = tmp; *sizeP = count; } alist->prlist_val[alist->prlist_len++] = id; -- 2.39.5