Fixed some memory leaks in det_depends.c