Opened 13 years ago

#1146 new Defect

Memory leaks in sample_bitwise_validator.cpp

Reported by: tj2020 Owned by:
Priority: Undetermined Milestone: Undetermined
Component: Undetermined Version: 6.13.8
Keywords: memory leak Cc:

Description

In sched/sample_bitwise_validator.cpp we have;

int init_result(RESULT& result, void*& data) {
...
FILE_CKSUM_LIST* fcl = new FILE_CKSUM_LIST;
....
retval = get_output_file_infos(result, files);
if (retval) {
  log_messages.printf(...);
  return retval;
}
...
data = (void*) fcl;

The function returns from the if (retval) block without freeing the allocated memory (or assigning fcl to the out parameter, data).

The same mistake is repeated inside the for loop few lines later.

Change History (0)

Note: See TracTickets for help on using tickets.