Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpuser Plug recently introduced memory leak: releas...



details:   https://anonhg.NetBSD.org/src/rev/35ba7a907e04
branches:  trunk
changeset: 759046:35ba7a907e04
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Nov 26 10:59:14 2010 +0000

description:
Plug recently introduced memory leak: release lwp after use instead of
just switching away.

Also, make freeing syscall arguments a little more symmetric.

diffstat:

 lib/librumpuser/rumpuser_sp.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (38 lines):

diff -r a85f1414a6d9 -r 35ba7a907e04 lib/librumpuser/rumpuser_sp.c
--- a/lib/librumpuser/rumpuser_sp.c     Fri Nov 26 09:25:39 2010 +0000
+++ b/lib/librumpuser/rumpuser_sp.c     Fri Nov 26 10:59:14 2010 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpuser_sp.c,v 1.15 2010/11/25 17:59:02 pooka Exp $  */
+/*      $NetBSD: rumpuser_sp.c,v 1.16 2010/11/26 10:59:14 pooka Exp $  */
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: rumpuser_sp.c,v 1.15 2010/11/25 17:59:02 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_sp.c,v 1.16 2010/11/26 10:59:14 pooka Exp $");
 
 #include <sys/types.h>
 #include <sys/atomic.h>
@@ -421,8 +421,7 @@
 
        lwproc_newlwp(spc->spc_pid);
        rv = rumpsyscall(sysnum, data, retval);
-       lwproc_switch(NULL);
-       free(data);
+       lwproc_release();
 
        DPRINTF(("rump_sp: got return value %d & %d/%d\n",
            rv, retval[0], retval[1]));
@@ -442,7 +441,8 @@
 
        serv_handlesyscall(barg->sba_spc, &barg->sba_hdr, barg->sba_data);
        spcrelease(barg->sba_spc);
-       free(arg);
+       free(barg->sba_data);
+       free(barg);
        return NULL;
 }
 



Home | Main Index | Thread Index | Old Index