
Repair build_path so it returns dir and name joined into a block the caller frees, leaving nothing else allocated.
build_path("/usr/local", "bin")[/usr/local/bin]build_path("/tmp/", "core.log")[/tmp/core.log]build_path("", "Makefile")[Makefile]build_path("/etc", "")[/etc/]build_path(NULL, "bin")nullread_the_leak.cmallocfree<stdlib.h>declares malloc, free, size_t and NULL
Run the tests to grade your code
Repair build_path so it returns dir and name joined into a block the caller frees, leaving nothing else allocated.
build_path("/usr/local", "bin")[/usr/local/bin]build_path("/tmp/", "core.log")[/tmp/core.log]build_path("", "Makefile")[Makefile]build_path("/etc", "")[/etc/]build_path(NULL, "bin")nullread_the_leak.cmallocfree<stdlib.h>declares malloc, free, size_t and NULL
Run the tests to grade your code
Memory will appear here