From 1d7264c97b79c6f87b505407a3979c17f93ca9f1 Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 18 Nov 2011 09:56:40 +0000 Subject: Free unused allocation on error. Reported by: slonoman2011 yandex ru MFC after: 1 week --- lib/librt/timer.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/librt') diff --git a/lib/librt/timer.c b/lib/librt/timer.c index f02e761..90269c2 100644 --- a/lib/librt/timer.c +++ b/lib/librt/timer.c @@ -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); } -- cgit v1.1