Klocwork test suite Test suite #106
DownloadDescription
Klocwork, Inc. donated 41 C and C++ test cases from the regression test suite for their tool. Most are related to memory management, e.g., memory leak, bad free, and use after free.
Displaying test cases 1 - 25 of 41 in total
-
Pointer to allocated memory is not returned in function foo2(), and memory cannot be subsequently freed.
-
Attempted free of memory which has not been allocated.
-
Attempt to free memory which has not been allocated.
-
Attempted free of unallocated memory, with control flow.
-
Memory allocated via new() constructor is deallocated via delete() call.
-
An integer value is incorreclly assigned using a memory address that will overread the buffer containing an integer array.
-
An integer pointer is assigned an address value below the current buffer address.
-
Integer pointer is assigned an address value beyond current buffer.
-
Integer pointer is assigned address below current buffer.
-
Integer pointer is assigned a value beyond current buffer.
-
Integer pointer is assigned value beyond current buffer, using sizeof () function without brackets.
-
Pointer is set to 0, but memory is not freed in function.
-
No memory leak because of proper use of the delete() function.
-
Memory pointer is returned in function return value, and therefore can be freed at another point in the program.
-
Allocated memory is freed nor returned in function call.
-
Interprocedurally allocated memory is not freed in function.
-
Memory allocated via malloc() is not freed, nor is pointer returned from function.
-
Memory allocated via malloc() is not freed nor is its pointer returned in by the function.
-
Pointer is not initialized prior assigning an integer value to its location.
-
Integer is not initialized prior to being used in boolean expression.
-
Integer is not assigned a value prior to use in a boolean expression.
-
Integer is not initialized prior to being incremented in an expression.
-
Pointer is not initialized prior to being used to assign a value to an array element
-
Integer is not initialized prior to being used as an array index.
-
Variable used in boolean expression is correctly initialized before use.