Code Room
Code reviewHard
Question
Review this C resource-cleanup path.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
#include <stdlib.h> int load(const char *path, char **out) { char *buf = malloc(1024); if (!buf) return -1; if (read_file(path, buf, 1024) < 0) { free(buf); goto fail; } *out = buf; return 0;fail: free(buf); return -1;}Run or narrate your approach, then ask the coach.