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

src/mess/tools/imgtool/stream.c
r4026r4027
453453         if (!ptr)
454454            return IMGTOOLERR_OUTOFMEMORY;
455455         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);
457459            return IMGTOOLERR_READERROR;
460         }
458461         *result = crc32(0, ptr, sz);
459462         free(ptr);
460463         break;
src/mess/machine/microtan.c
r4026r4027
846846   buff = malloc(quickload_size + 1);
847847   if (!buff)
848848   {
849      free(snapshot_buff);
849850      LOG(("microtan_hexfile_load: could not allocate %d bytes of buffer\n", quickload_size));
850851      return INIT_FAIL;
851852   }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team