Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpuffs puffs_cc_yield: fix a cc leak. PR/44679



details:   https://anonhg.NetBSD.org/src/rev/4be720ba2a38
branches:  trunk
changeset: 770810:4be720ba2a38
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Nov 02 16:43:04 2011 +0000

description:
puffs_cc_yield: fix a cc leak.  PR/44679

diffstat:

 lib/libpuffs/callcontext.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 8152427635ed -r 4be720ba2a38 lib/libpuffs/callcontext.c
--- a/lib/libpuffs/callcontext.c        Wed Nov 02 16:39:23 2011 +0000
+++ b/lib/libpuffs/callcontext.c        Wed Nov 02 16:43:04 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: callcontext.c,v 1.25 2011/03/04 09:47:47 yamt Exp $    */
+/*     $NetBSD: callcontext.c,v 1.26 2011/11/02 16:43:04 yamt Exp $    */
 
 /*
  * Copyright (c) 2006, 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: callcontext.c,v 1.25 2011/03/04 09:47:47 yamt Exp $");
+__RCSID("$NetBSD: callcontext.c,v 1.26 2011/11/02 16:43:04 yamt Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -78,6 +78,14 @@
 
        assert(puffs_fakecc == 0);
 
+       if ((~pcc->pcc_flags & (PCC_BORROWED|PCC_DONE)) == 0) {
+               pcc->pcc_flags &= ~(PCC_BORROWED|PCC_DONE);
+               /*
+                * see the XXX comment in puffs__cc_cont
+                */
+               puffs__cc_destroy(pcc, 1);
+               setcontext(&pcc->pcc_uc_ret);
+       }
        pcc->pcc_flags &= ~PCC_BORROWED;
 
        /* romanes eunt domus */



Home | Main Index | Thread Index | Old Index