Reacted on warning about theoretical memory leak.

This commit is contained in:
Thomas Schmitt 2011-03-28 20:43:13 +02:00
parent 71efc996e3
commit c0bdf4d3b5

View File

@ -337,14 +337,16 @@ static
int rrip_add_NM(Ecma119Image *t, struct susp_info *susp, char *name, int size, int rrip_add_NM(Ecma119Image *t, struct susp_info *susp, char *name, int size,
int flags, int ce) int flags, int ce)
{ {
uint8_t *NM = malloc(size + 5); uint8_t *NM;
if (NM == NULL) {
return ISO_OUT_OF_MEM;
}
if (size > 250) if (size > 250)
return ISO_ASSERT_FAILURE; return ISO_ASSERT_FAILURE;
NM = malloc(size + 5);
if (NM == NULL) {
return ISO_OUT_OF_MEM;
}
NM[0] = 'N'; NM[0] = 'N';
NM[1] = 'M'; NM[1] = 'M';
NM[2] = size + 5; NM[2] = size + 5;