1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-03 12:35:02 +00:00

Free unused allocation on error.

Reported by:	slonoman2011 yandex ru
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2011-11-18 09:56:40 +00:00
parent 953cc85489
commit 289317dac9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227661

View File

@ -102,12 +102,14 @@ __timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid)
}
if (__sigev_check_init()) {
free(timer);
errno = EINVAL;
return (-1);
}
sn = __sigev_alloc(SI_TIMER, evp, NULL, 0);
if (sn == NULL) {
free(timer);
errno = EAGAIN;
return (-1);
}