Build row-pointer matrices with partial-failure cleanup

Allocate an int ** matrix as a pointer table plus one independent int array per row. Read rows and cols in 1..10 plus fail_on: 0 means no deliberately forced failure; 1 means fail the table allocation; k > 1 means fail allocation attempt k, counting the table first. Use a simple allocator wrapper that returns NULL on that attempt and otherwise calls malloc. Fill a[r][c] = 10*r + c and print the sum on success. On failure, print exactly how many already-allocated rows you released. Draw ownership after the second row allocation and show cleanup order. Real malloc failure must follow the same safe path.


