From owner-freebsd-bugs Fri Dec 7 14:30: 8 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 90FEA37B416 for ; Fri, 7 Dec 2001 14:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fB7MU1l96219; Fri, 7 Dec 2001 14:30:01 -0800 (PST) (envelope-from gnats) Received: from h132-197-179-27.gte.com (h132-197-179-27.gte.com [132.197.179.27]) by hub.freebsd.org (Postfix) with ESMTP id 86DB537B416; Fri, 7 Dec 2001 14:28:45 -0800 (PST) Received: (from ak03@localhost) by h132-197-179-27.gte.com (8.11.6/8.11.4) id fB7M73S67160; Fri, 7 Dec 2001 17:07:03 -0500 (EST) (envelope-from ak03) Message-Id: <200112072207.fB7M73S67160@h132-197-179-27.gte.com> Date: Fri, 7 Dec 2001 17:07:03 -0500 (EST) From: "Alexander N. Kabaev" Reply-To: "Alexander N. Kabaev" To: FreeBSD-gnats-submit@freebsd.org Cc: assar@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/32591: The memory block doubly freed in Heimdal Kerberos5 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 32591 >Category: bin >Synopsis: The memory block doubly freed in Heimdal Kerberos5 >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Dec 07 14:30:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Alexander N. Kabaev >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD kanpc.gte.com 5.0-CURRENT FreeBSD 5.0-CURRENT #10: Wed Dec 5 13:23:00 EST 2001 root@kanpc.gte.com:/usr/src/sys/i386/compile/KANPC i386 >Description: The /usr/src/crypto/heimdal/lib/krb5/keytab_any.c file contains the following code in function any_start_seq_get: >How-To-Repeat: N/A >Fix: Index: /usr/src/crypto/heimdal/lib/krb5/keytab_any.c =================================================================== RCS file: /usr/ncvs/src/crypto/heimdal/lib/krb5/keytab_any.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 keytab_any.c --- /usr/src/crypto/heimdal/lib/krb5/keytab_any.c 21 Jun 2001 02:11:33 -0000 1.1.1.1 +++ /usr/src/crypto/heimdal/lib/krb5/keytab_any.c 7 Dec 2001 21:51:38 -0000 @@ -139,7 +139,6 @@ ed->a = a; ret = krb5_kt_start_seq_get(context, ed->a->kt, &ed->cursor); if (ret) { - free (ed); free (c->data); c->data = NULL; krb5_set_error_string (context, "malloc: out of memory"); >Release-Note: >Audit-Trail: >Unformatted: >>>>>>>>>> ed = (struct any_cursor_extra_data *)c->data; ed->a = a; ret = krb5_kt_start_seq_get(context, ed->a->kt, &ed->cursor); if (ret) { free (ed); free (c->data); c->data = NULL; <<<<<<<<<< The free(ed) statement is bogus, because in this case c->data == ed, and it is not a very good idea to free the same memory block twice. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message