Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix a memory leak when we change pl_corename severa...



details:   https://anonhg.NetBSD.org/src/rev/b3c8456dbdf4
branches:  trunk
changeset: 517220:b3c8456dbdf4
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Nov 08 21:24:47 2001 +0000

description:
Fix a memory leak when we change pl_corename several times.

diffstat:

 sys/kern/kern_sysctl.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r f566ec5caa28 -r b3c8456dbdf4 sys/kern/kern_sysctl.c
--- a/sys/kern/kern_sysctl.c    Thu Nov 08 20:47:56 2001 +0000
+++ b/sys/kern/kern_sysctl.c    Thu Nov 08 21:24:47 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sysctl.c,v 1.95 2001/09/24 06:01:13 chs Exp $     */
+/*     $NetBSD: kern_sysctl.c,v 1.96 2001/11/08 21:24:47 bouyer Exp $  */
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -758,7 +758,8 @@
                                newplim = limcopy(ptmp->p_limit);
                                limfree(ptmp->p_limit);
                                ptmp->p_limit = newplim;
-                       } else if (ptmp->p_limit->pl_corename != defcorename) {
+                       }
+                       if (ptmp->p_limit->pl_corename != defcorename) {
                                free(ptmp->p_limit->pl_corename, M_TEMP);
                        }
                        ptmp->p_limit->pl_corename = tmps;



Home | Main Index | Thread Index | Old Index