Free unused allocation on error.
Reported by: slonoman2011 yandex ru MFC after: 1 week
This commit is contained in:
parent
e9eec31614
commit
1d7264c97b
@ -102,12 +102,14 @@ __timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (__sigev_check_init()) {
|
if (__sigev_check_init()) {
|
||||||
|
free(timer);
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
sn = __sigev_alloc(SI_TIMER, evp, NULL, 0);
|
sn = __sigev_alloc(SI_TIMER, evp, NULL, 0);
|
||||||
if (sn == NULL) {
|
if (sn == NULL) {
|
||||||
|
free(timer);
|
||||||
errno = EAGAIN;
|
errno = EAGAIN;
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user