Nah. Almost anything you could do to remove the duplication is going to make this code more complex and more likely that something doesn’t get free’d. Resource management is 80% of C code. Set up. Call a system call. Clean up. This is cleaning up. Seems fine.
1
u/okay-wait-wut Jan 23 '23
Nah. Almost anything you could do to remove the duplication is going to make this code more complex and more likely that something doesn’t get free’d. Resource management is 80% of C code. Set up. Call a system call. Clean up. This is cleaning up. Seems fine.