reko
reko copied to clipboard
Return value of malloc is getting lost
The following is the result of running Reko on subjects/Elf/Sparc/rtems:
// Called from:
// unexpand_if_needed
// output_bytes
Eq_n xrealloc(Eq_n o0, Eq_n o1, union Eq_n & i1Out, ptr32 & i2Out)
{
bool v23_n;
if (o0 != 0x00)
v23_n = realloc(o0, o1) != null;
else
v23_n = malloc(o1) != null;
// code elided
Clearly the intent is to keep the result of malloc and also compare it to null, but isn't happening.