release memory allocated for the list of capitalized monster type names */
| 936 | |
| 937 | /* release memory allocated for the list of capitalized monster type names */ |
| 938 | void |
| 939 | free_CapMons(void) |
| 940 | { |
| 941 | /* note: some elements of CapMons[] are string literals from |
| 942 | mons[].pmnames[] and should not be freed, others are dynamically |
| 943 | allocated copies of hallucinatory monster names and should be freed */ |
| 944 | if (CapMons) { |
| 945 | unsigned idx; |
| 946 | |
| 947 | /* skip 0..MonstCnt-1, free MonstCnt..(MonstCnt+BogonCnt-1) */ |
| 948 | for (idx = CapMonstCnt; idx < CapMonSiz - 1; ++idx) |
| 949 | free((genericptr_t) CapMons[idx]); /* cast: discard 'const' */ |
| 950 | free((genericptr_t) CapMons), CapMons = (const char **) 0; |
| 951 | } |
| 952 | CapMonSiz = 0; |
| 953 | } |
| 954 | #endif /* !SFCTOOL */ |
| 955 | |
| 956 | /*rumors.c*/ |
no outgoing calls
no test coverage detected