| Previous | 15994 Revisions | Next |
| r4027 Tuesday 30th December, 2008 at 22:20:38 UTC by Firewave |
|---|
| Fixed potential memory leaks reported by cppcheck |
| [src/mess/machine] | microtan.c |
| [src/mess/tools/imgtool] | stream.c |
| r4026 | r4027 | |
|---|---|---|
| 453 | 453 | if (!ptr) |
| 454 | 454 | return IMGTOOLERR_OUTOFMEMORY; |
| 455 | 455 | stream_seek(s, 0, SEEK_SET); |
| 456 | if (stream_read(s, ptr, sz) != sz) | |
| 456 | if (stream_read(s, ptr, sz) != sz) | |
| 457 | { | |
| 458 | free(ptr); | |
| 457 | 459 | return IMGTOOLERR_READERROR; |
| 460 | } | |
| 458 | 461 | *result = crc32(0, ptr, sz); |
| 459 | 462 | free(ptr); |
| 460 | 463 | break; |
| r4026 | r4027 | |
|---|---|---|
| 846 | 846 | buff = malloc(quickload_size + 1); |
| 847 | 847 | if (!buff) |
| 848 | 848 | { |
| 849 | free(snapshot_buff); | |
| 849 | 850 | LOG(("microtan_hexfile_load: could not allocate %d bytes of buffer\n", quickload_size)); |
| 850 | 851 | return INIT_FAIL; |
| 851 | 852 | } |
| Previous | 15994 Revisions | Next |