src/mess/cheatms.c
| r7125 | r7126 | |
| 31 | 31 | { |
| 32 | 32 | int listIdx; |
| 33 | 33 | const device_config *img; |
| 34 | static UINT32 *tmp_list = NULL; |
| 34 | 35 | |
| 35 | 36 | free(device_crc_list); |
| 36 | 37 | |
| 37 | 38 | /* allocate list with single member (0x00000000) */ |
| 38 | 39 | device_crc_list = (UINT32*)malloc(sizeof(UINT32)); |
| 40 | memset(device_crc_list,0,sizeof(UINT32)); |
| 39 | 41 | device_crc_list_length = 1; |
| 40 | 42 | |
| 41 | 43 | for (img = image_device_first(machine->config); img != NULL; img = image_device_next(img)) |
| r7125 | r7126 | |
| 59 | 61 | { |
| 60 | 62 | if(!this_game_crc) |
| 61 | 63 | this_game_crc = crc; |
| 64 | |
| 65 | tmp_list = (UINT32*)malloc((device_crc_list_length + 1) * sizeof(UINT32)); |
| 66 | memcpy(tmp_list,device_crc_list,device_crc_list_length * sizeof(UINT32)); |
| 62 | 67 | if (device_crc_list) free(device_crc_list); |
| 63 | | device_crc_list = (UINT32*)malloc((device_crc_list_length + 1) * sizeof(UINT32)); |
| 68 | device_crc_list = tmp_list; |
| 64 | 69 | |
| 65 | 70 | device_crc_list[device_crc_list_length] = crc; |
| 66 | 71 | device_crc_list_length++; |