diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 8b6915f021..9d9d228376 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -138,7 +138,7 @@ afsconf_fopen(const char *fname, const char *fmode) iop->buffer = malloc(BUFFER); if (iop->buffer == NULL) { (void) close(fd); - free((void *) iop); + free(iop); errno = ENOMEM; return NULL; } @@ -154,8 +154,8 @@ afsconf_fclose(afsconf_FILE *iop) return 0; } close(iop->_file); - free((void *)iop->buffer); - free((void *)iop); + free(iop->buffer); + free(iop); return 0; } diff --git a/src/bucoord/commands.c b/src/bucoord/commands.c index b4de99441b..ea8b9c0400 100644 --- a/src/bucoord/commands.c +++ b/src/bucoord/commands.c @@ -353,7 +353,7 @@ EvalVolumeSet2(struct bc_config *aconfig, /* Free memory allocated during VL call */ if (bulkentries.nbulkentries_val) { - free((char *)bulkentries.nbulkentries_val); + free(bulkentries.nbulkentries_val); bulkentries.nbulkentries_val = 0; entries = 0; } @@ -366,7 +366,7 @@ EvalVolumeSet2(struct bc_config *aconfig, error_exit: if (bulkentries.nbulkentries_val) { - free((char *)bulkentries.nbulkentries_val); + free(bulkentries.nbulkentries_val); } return (code); } /*EvalVolumeSet2 */ diff --git a/src/budb/server.c b/src/budb/server.c index d78b2822fc..4090edb844 100644 --- a/src/budb/server.c +++ b/src/budb/server.c @@ -307,7 +307,7 @@ parseServerList(struct cmd_item *itemPtr) ERROR(code); /* free space for the server args */ - free((char *)serverArgs); + free(serverArgs); error_exit: return (code); diff --git a/src/libadmin/cfg/cfgdb.c b/src/libadmin/cfg/cfgdb.c index 9f946b953d..b68db54f29 100644 --- a/src/libadmin/cfg/cfgdb.c +++ b/src/libadmin/cfg/cfgdb.c @@ -341,8 +341,8 @@ int ADMINAPI cfg_CellServDbStatusDeallocate(cfg_cellServDbStatus_t * statusItempP, afs_status_p st) { - if ( statusItempP ) - free((void *)statusItempP); + if ( statusItempP ) + free(statusItempP); if (st != NULL) { *st = 0; diff --git a/src/libadmin/cfg/cfghost.c b/src/libadmin/cfg/cfghost.c index bdf152e669..5c40e23662 100644 --- a/src/libadmin/cfg/cfghost.c +++ b/src/libadmin/cfg/cfghost.c @@ -1206,7 +1206,7 @@ int ADMINAPI cfg_StringDeallocate(char *stringDataP, /* (multi)string to deallocate */ afs_status_p st) { /* completion status */ - free((void *)stringDataP); + free(stringDataP); if (st != NULL) { *st = 0; } @@ -1222,7 +1222,7 @@ int ADMINAPI cfg_PartitionListDeallocate(cfg_partitionEntry_t * partitionListDataP, afs_status_p st) { - free((void *)partitionListDataP); + free(partitionListDataP); if (st != NULL) { *st = 0; } diff --git a/src/lwp/lwp_nt.c b/src/lwp/lwp_nt.c index c37baebda4..5bfb553c2f 100644 --- a/src/lwp/lwp_nt.c +++ b/src/lwp/lwp_nt.c @@ -231,7 +231,7 @@ int LWP_CreateProcess(int (*funP)(), int stacksize, int priority, void *argP, pcb->fiber = CreateFiber(stacksize, Enter_LWP, pcb); if (pcb->fiber == NULL) { - free((void*)pcb); + free(pcb); return LWP_EINIT; } Debug(0, ("Create: pcb=0x%p, funP=0x%p, argP=0x%p\n", pcb, funP, argP)) @@ -622,8 +622,8 @@ static void Free_PCB(PROCESS pid) if (pid->fiber != NULL) { DeleteFiber(pid->fiber); } - if (pid->eventlist != NULL) free((void*)pid->eventlist); - free((void*)pid); + if (pid->eventlist != NULL) free(pid->eventlist); + free(pid); } static void Dispose_of_Dead_PCB(PROCESS cur) diff --git a/src/lwp/test/selsubs.c b/src/lwp/test/selsubs.c index f3403a155e..0567851df3 100644 --- a/src/lwp/test/selsubs.c +++ b/src/lwp/test/selsubs.c @@ -46,7 +46,7 @@ IOMGR_AllocFDSet(void) void IOMGR_FreeFDSet(fd_set * fds) { - free((char *)fds); + free(fds); } #endif diff --git a/src/ptserver/map.c b/src/ptserver/map.c index 9c74bc8df7..ec94a10cb3 100644 --- a/src/ptserver/map.c +++ b/src/ptserver/map.c @@ -196,7 +196,7 @@ simplify_bitmap(struct bitmap *map) mp2->m_page); #endif *mpp = mp2->m_next; - free((char *)mp2); + free(mp2); } else mpp = &mp2->m_next; } @@ -214,7 +214,7 @@ or_bitmap(struct bitmap *left, struct bitmap *right) for (i = 0; i < MDATA; ++i) lmap->m_data[i] |= rmap->m_data[i]; *rightmp = rmap->m_next; - free((char *)rmap); + free(rmap); break; } } @@ -237,14 +237,14 @@ and_bitmap(struct bitmap *left, struct bitmap *right) for (i = 0; i < MDATA; ++i) sig |= (lmap->m_data[i] &= rmap->m_data[i]); *rightmp = rmap->m_next; - free((char *)rmap); + free(rmap); break; } if (rmap && sig) { leftmp = &lmap->m_next; } else { *leftmp = lmap->m_next; - free((char *)lmap); + free(lmap); } } free_map((struct map *)right); @@ -270,14 +270,14 @@ bic_bitmap(struct bitmap *left, struct bitmap *right) for (i = 0; i < MDATA; ++i) sig |= (lmap->m_data[i] &= ~rmap->m_data[i]); *rightmp = rmap->m_next; - free((char *)rmap); + free(rmap); break; } if (!rmap || sig) { leftmp = &lmap->m_next; } else { *leftmp = lmap->m_next; - free((char *)lmap); + free(lmap); } } free_map((struct map *)right); diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index b6601d6d7e..f38daac5db 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -123,7 +123,7 @@ popsource(void) fclose(source); source = sp->s_file; shead = sp->s_next; - free((char *)sp); + free(sp); return 1; } diff --git a/src/util/readdir_nt.c b/src/util/readdir_nt.c index 18fb4d4f81..7a18f0134f 100644 --- a/src/util/readdir_nt.c +++ b/src/util/readdir_nt.c @@ -96,7 +96,7 @@ closedir(DIR * dir) if (dir->h != INVALID_HANDLE_VALUE) FindClose(dir->h); - free((void *)dir); + free(dir); return 0; } diff --git a/src/vfsck/inode.c b/src/vfsck/inode.c index d4e902c734..58fc980e47 100644 --- a/src/vfsck/inode.c +++ b/src/vfsck/inode.c @@ -354,9 +354,9 @@ inocleanup() if (inphead == NULL) return; for (inpp = &inpsort[inplast - 1]; inpp >= inpsort; inpp--) - free((char *)(*inpp)); - free((char *)inphead); - free((char *)inpsort); + free(*inpp); + free(inphead); + free(inpsort); inphead = inpsort = NULL; } #endif diff --git a/src/vfsck/main.c b/src/vfsck/main.c index 408f8f7a93..55bb12ba8e 100644 --- a/src/vfsck/main.c +++ b/src/vfsck/main.c @@ -893,7 +893,7 @@ checkfilesys(filesys, parname) ckfini(); free(blockmap); free(statemap); - free((char *)lncntp); + free(lncntp); lncntp = NULL; blockmap = statemap = NULL; #ifdef AFS_SUN5_ENV diff --git a/src/vfsck/pass4.c b/src/vfsck/pass4.c index fd7d51962d..86c8a214c4 100644 --- a/src/vfsck/pass4.c +++ b/src/vfsck/pass4.c @@ -96,7 +96,7 @@ pass4() zlnp->zlncnt = zlnhead->zlncnt; zlnp = zlnhead; zlnhead = zlnhead->next; - free((char *)zlnp); + free(zlnp); clri(&idesc, "UNREF", 1); break; } @@ -176,7 +176,7 @@ pass4check(idesc) dlp->dup = duplist->dup; dlp = duplist; duplist = duplist->next; - free((char *)dlp); + free(dlp); break; } if (dlp == 0) { diff --git a/src/vfsck/utilities.c b/src/vfsck/utilities.c index 4b8dd440df..1249bcb80d 100644 --- a/src/vfsck/utilities.c +++ b/src/vfsck/utilities.c @@ -364,7 +364,7 @@ ckfini() flush(fswritefd, bp); nbp = bp->b_prev; free(bp->b_un.b_buf); - free((char *)bp); + free(bp); } #ifdef AFS_SUN5_ENVX pbp = pdirbp = NULL; diff --git a/src/viced/host.c b/src/viced/host.c index 0102da476e..54d9604fa1 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -999,7 +999,7 @@ h_Enumerate(int (*proc) (struct host*, void *), void *param) } H_UNLOCK; } - free((void *)list); + free(list); } /* h_Enumerate */ diff --git a/src/vlserver/vlclient.c b/src/vlserver/vlclient.c index 7d55e7bed7..ee6b554310 100644 --- a/src/vlserver/vlclient.c +++ b/src/vlserver/vlclient.c @@ -535,7 +535,7 @@ handleit(struct cmd_syndesc *as, void *arock) for (i = 0; i < nentries; i++, entry++) display_entry(entry, 0); if (entries.bulkentries_val) - free((char *)entries.bulkentries_val); + free(entries.bulkentries_val); } else if (!strcmp(oper, "lan2")) { int nentries, i, si, nsi, t = 0; nbulkentries entries; @@ -572,7 +572,7 @@ handleit(struct cmd_syndesc *as, void *arock) for (i = 0; i < nentries; i++, entry++) display_entryN(entry, 0); if (entries.nbulkentries_val) - free((char *)entries.nbulkentries_val); + free(entries.nbulkentries_val); } printf("--- %d volumes ---\n", t); } else if (!strcmp(oper, "ln")) { @@ -617,7 +617,7 @@ handleit(struct cmd_syndesc *as, void *arock) for (vllist = linkedvldbs.node; vllist; vllist = vllist1) { vllist1 = vllist->next_vldb; display_entry((struct vldbentry *)&vllist->VldbEntry, 0); - free((char *)vllist); + free(vllist); } } else if (!strcmp(oper, "di")) { sscanf(&(*argp)[0], "%d", &id); @@ -743,7 +743,7 @@ handleit(struct cmd_syndesc *as, void *arock) printf("[0x%x %u] %s\n", *addrp, *addrp, hostutil_GetNameByINet(ntohl(*addrp))); } - free((char *)addrs.bulkaddrs_val); + free(addrs.bulkaddrs_val); } else if (!strcmp(oper, "gau")) { int nentries, i, j; afs_uint32 *addrp; @@ -799,13 +799,13 @@ handleit(struct cmd_syndesc *as, void *arock) hostutil_GetNameByINet(mhaddrp[j])); } if (mhaddrs.bulkaddrs_val) - free((char *)mhaddrs.bulkaddrs_val); + free(mhaddrs.bulkaddrs_val); } else { printf("[0x%x %u] %s\n", *addrp, *addrp, hostutil_GetNameByINet(ntohl(*addrp))); } } - free((char *)addrs.bulkaddrs_val); + free(addrs.bulkaddrs_val); } else if (!strcmp(oper, "mhc")) { afs_uint32 serveraddrs[MAXSERVERID + 1][VL_MAXIPADDRS_PERMH]; afs_int32 serveraddrtype[MAXSERVERID + 1]; @@ -860,7 +860,7 @@ handleit(struct cmd_syndesc *as, void *arock) for (j = 0; j < nentries2; j++) { serveraddrs[i][j] = ntohl(addrp2[j]); } - free((char *)addrs2.bulkaddrs_val); + free(addrs2.bulkaddrs_val); } if (nargs) { @@ -875,7 +875,7 @@ handleit(struct cmd_syndesc *as, void *arock) } } } - free((char *)addrs1.bulkaddrs_val); + free(addrs1.bulkaddrs_val); /* Look for any duplicates */ for (i = 0; i < MAXSERVERID + 1; i++) { diff --git a/src/vlserver/vlprocs.c b/src/vlserver/vlprocs.c index 6868edba12..aebc95cda4 100644 --- a/src/vlserver/vlprocs.c +++ b/src/vlserver/vlprocs.c @@ -1760,7 +1760,7 @@ SVL_ListAttributesN2(struct rx_call *rxcall, countAbort(this_op); ubik_AbortTrans(ctx.trans); if (vldbentries->nbulkentries_val) - free((char *)vldbentries->nbulkentries_val); + free(vldbentries->nbulkentries_val); vldbentries->nbulkentries_val = 0; vldbentries->nbulkentries_len = 0; *nextstartindex = -1; diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index da1d2dfb8f..5be20ca348 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -757,7 +757,7 @@ xfs_ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile, closedir(top_dirp); if (renames) - free((char *)renames); + free(renames); if (inodeFile != INVALID_FD) { if (OS_SYNC(inodeFile) == -1) { Log("Unable to successfully fsync inode file for %s\n", mountedOn); @@ -787,7 +787,7 @@ xfs_ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile, if (top_dirp) closedir(top_dirp); if (renames) - free((char *)renames); + free(renames); return -1; } diff --git a/src/vol/volume.c b/src/vol/volume.c index dc8a4b3dc7..a293c58b05 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -6489,7 +6489,7 @@ VGetBitmap_r(Error * ec, Volume * vp, VnodeClass class) vip->bitmap = BitMap; vip->bitmapOffset = 0; } else - free((byte *) BitMap); + free(BitMap); #endif /* BITMAP_LATER */ #ifdef AFS_DEMAND_ATTACH_FS VChangeState_r(vp, state_save); diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index 91f725c8fd..be52de22cc 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -1295,9 +1295,9 @@ RestoreVolume(struct rx_call *call, Volume * avp, int incremental, out: /* Free the malloced space above */ if (b1) - free((char *)b1); + free(b1); if (b2) - free((char *)b2); + free(b2); return error; }