1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Fix fd resource leak in error path

Use 'goto bad' to cleanup fd on error path.
This commit is contained in:
Zdenek Kabelac 2012-02-08 11:07:17 +00:00
parent 4443aa41cc
commit e48d39cba0
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.70 -
===================================
Fix fd resource leak in error path for _udev_notify_sem_create().
Leave space for '\0' for readline() call in _sysfs_get_kernel_name().
Version 1.02.69 - 1st February 2012

View File

@ -1738,7 +1738,7 @@ static int _udev_notify_sem_create(uint32_t *cookie, int *semid)
log_error("semid %d: sem_ctl GETVAL failed for "
"cookie 0x%" PRIx32 ": %s",
gen_semid, gen_cookie, strerror(errno));
return 0;
goto bad;
}
log_debug("Udev cookie 0x%" PRIx32 " (semid %d) incremented to %d",