3 ms·
I'm not sure I'd do either for this trivial case, but it might make sense where the cleanup logic is more complex? void* p1 = malloc(...); void* p2 = m
by bobmcnamara 2y ago
I'm not sure I'd do either for this trivial case, but it might make sense where the cleanup logic is more complex?
void* p1 = malloc(...);
void* p2 = malloc(...);
void* p3 = malloc(...);
if(p1 && p2 && p3)
return {p1, p2, p3};
free(p3);
free(p2);
free(p1);
return NULL;