From owner-svn-src-all@FreeBSD.ORG Fri Nov 18 09:56:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C52131065679; Fri, 18 Nov 2011 09:56:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 619658FC0A; Fri, 18 Nov 2011 09:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAI9uebJ065066; Fri, 18 Nov 2011 09:56:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAI9ueUs065064; Fri, 18 Nov 2011 09:56:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201111180956.pAI9ueUs065064@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 18 Nov 2011 09:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227661 - head/lib/librt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 09:56:40 -0000 Author: kib Date: Fri Nov 18 09:56:40 2011 New Revision: 227661 URL: http://svn.freebsd.org/changeset/base/227661 Log: Free unused allocation on error. Reported by: slonoman2011 yandex ru MFC after: 1 week Modified: head/lib/librt/timer.c Modified: head/lib/librt/timer.c ============================================================================== --- head/lib/librt/timer.c Fri Nov 18 09:55:47 2011 (r227660) +++ head/lib/librt/timer.c Fri Nov 18 09:56:40 2011 (r227661) @@ -102,12 +102,14 @@ __timer_create(clockid_t clockid, struct } 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); }