From owner-freebsd-isdn@FreeBSD.ORG Mon Aug 1 11:01:59 2005 Return-Path: X-Original-To: freebsd-isdn@freebsd.org Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 827DD16A420 for ; Mon, 1 Aug 2005 11:01:59 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21AF943D45 for ; Mon, 1 Aug 2005 11:01:59 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j71B1xQi017191 for ; Mon, 1 Aug 2005 11:01:59 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j71B1wh6017185 for freebsd-isdn@freebsd.org; Mon, 1 Aug 2005 11:01:58 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 1 Aug 2005 11:01:58 GMT Message-Id: <200508011101.j71B1wh6017185@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-isdn@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2005 11:01:59 -0000 Current FreeBSD problem reports Critical problems Serious problems Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2004/11/16] bin/73988 isdn ISDN - first dial attempt fails o [2005/01/23] kern/76611 isdn [patch] i4b itjc bad enums for PIB cycle o [2005/03/22] kern/79117 isdn iavc(4) for AVM B1 PCI does not attach 3 problems total. From owner-freebsd-isdn@FreeBSD.ORG Thu Aug 4 11:40:43 2005 Return-Path: X-Original-To: freebsd-isdn@freebsd.org Delivered-To: freebsd-isdn@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAC0D16A41F for ; Thu, 4 Aug 2005 11:40:43 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.swipnet.se [212.247.155.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6534243D49 for ; Thu, 4 Aug 2005 11:40:43 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: gvlK0tOCzrqh9CPROFOFPw== Received: from mp-217-207-214.daxnet.no ([193.217.207.214] verified) by mailfe15.swip.net (CommuniGate Pro SMTP 4.3.4) with ESMTP id 3481784; Thu, 04 Aug 2005 13:40:41 +0200 From: Hans Petter Selasky To: asterisk-bsd@lists.digium.com, freebsd-isdn@freebsd.org Date: Thu, 4 Aug 2005 13:41:39 +0200 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200508041341.40949.hselasky@c2i.net> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: Subject: Memory leak in chan_capi X-BeenThere: freebsd-isdn@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: Using ISDN with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2005 11:40:44 -0000 Hi,=20 I think there is a memory leak in chan_capi, if anyone is using it. Memory is duplicated with strdup, but never freed. Solution: use alloca(). Here is a patch: enum { max_telno =3D 256 }; /* including terminating zero */ static char *capi_number(u_int8_t *data, int strip, u_int8_t *buf) { #define capi_number(data,strip) capi_number(data,strip,(u_int8_t=20 *)alloca(max_telno)) =A0 =A0u_int16_t len; =A0 =A0/* convert a CAPI structure into a=20 =A0 =A0 * zero terminated string=20 =A0 =A0 */ =A0 =A0if(data[0] =3D=3D 0xFF) =A0 =A0{ =A0 =A0 =A0 len =3D data[1]|(data[2] << 8); =A0 =A0 =A0 data +=3D 3; =A0 =A0} =A0 =A0else =A0 =A0{ =A0 =A0 =A0 len =3D data[0]; =A0 =A0 =A0 data +=3D 1; =A0 =A0} =A0 =A0if(len >=3D max_telno) =A0 =A0 =A0 len =3D max_telno-1; =A0 =A0bcopy(data, buf, len); =A0 =A0buf[len] =3D 0; =A0 =A0return (char *)buf; } =2D-HPS