Project

General

Profile

Submit #2784 ยป 0001-lib-libhammer-fix-minor-memory-leak.patch

tkusumi, 02/06/2015 12:45 PM

View differences:

lib/libhammer/misc.c
pfs.pfs_id = -1;
pfs.ondisk = &pfsd;
pfs.bytes = sizeof(struct hammer_pseudofs_data);
fd = open(mnt->f_mntonname, O_RDONLY);
if ((fd = open(mnt->f_mntonname, O_RDONLY)) < 0) {
curmount--;
continue;
}
if (ioctl(fd, HAMMERIOC_GET_PSEUDOFS, &pfs) < 0) {
close(fd);
curmount--;
......
memcpy(&uuid, &pfs.ondisk->unique_uuid, sizeof(uuid));
if (uuid_compare(unique_uuid, &uuid, NULL) == 0) {
retval = strdup(mnt->f_mntonname);
break;
retval = strdup(mnt->f_mntonname);
close(fd);
break;
}
curmount--;
    (1-1/1)