From owner-p4-projects@FreeBSD.ORG Fri Dec 31 14:55:02 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4D6AA16A4D7; Fri, 31 Dec 2004 14:55:02 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF66F16A4DB for ; Fri, 31 Dec 2004 14:55:01 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B34BC43D39 for ; Fri, 31 Dec 2004 14:55:01 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iBVEt13v009098 for ; Fri, 31 Dec 2004 14:55:01 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iBVEt1ml009095 for perforce@freebsd.org; Fri, 31 Dec 2004 14:55:01 GMT (envelope-from davidxu@freebsd.org) Date: Fri, 31 Dec 2004 14:55:01 GMT Message-Id: <200412311455.iBVEt1ml009095@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to davidxu@freebsd.org using -f From: David Xu To: Perforce Change Reviews Subject: PERFORCE change 67976 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Dec 2004 14:55:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=67976 Change 67976 by davidxu@davidxu_tiger on 2004/12/31 14:54:57 don't free cleanup object on stack. Affected files ... .. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_clean.c#2 edit Differences ... ==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_clean.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/lib/libpthread/thread/thr_clean.c,v 1.8 2003/04/18 05:04:15 deischen Exp $ + * $FreeBSD: src/lib/libpthread/thread/thr_clean.c,v 1.9 2004/12/18 18:07:37 deischen Exp $ */ #include #include @@ -50,6 +50,7 @@ malloc(sizeof(struct pthread_cleanup))) != NULL) { new->routine = routine; new->routine_arg = routine_arg; + new->onstack = 0; new->next = curthread->cleanup; curthread->cleanup = new; @@ -67,6 +68,7 @@ if (execute) { old->routine(old->routine_arg); } - free(old); + if (old->onstack == 0) + free(old); } }