]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
ptserver: Simplify malloc assignment to shut up clang
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 12 Feb 2013 13:12:47 +0000 (13:12 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Wed, 20 Feb 2013 20:30:08 +0000 (12:30 -0800)
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 <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/ptserver/ptutils.c

index 5a1b740b59393dd918465d3e60c467803500715a..144d07af3e94f3396e77d2ac2e20274be8904a99 100644 (file)
@@ -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;