Project

General

Profile

Submit #2778 » 0001-lib-libhammer-fix-minor-memory-leaks.patch

tkusumi, 01/25/2015 06:59 AM

View differences:

lib/libhammer/misc.c
mntbufsize = (mntsize) * sizeof(struct statfs);
mntbuf = _libhammer_malloc(mntbufsize);
if (mntbuf == NULL) {
perror("show_info");
exit(EXIT_FAILURE);
}
mntsize = getfsstat(mntbuf, (long)mntbufsize, MNT_NOWAIT);
curmount = mntsize - 1;
......
}
if ((ioctl(fd, HAMMERIOC_GET_INFO, &hi)) < 0) {
close(fd);
curmount--;
continue;
}
......
close(fd);
}
free(trailstr);
free(mntbuf);
return retval;
}
(1-1/3)