Source-Changes-HG archive

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

[src/trunk]: src/bin/ps ps(1): Guard freeing the memory of pinfo with __NO_LE...



details:   https://anonhg.NetBSD.org/src/rev/2acabe811423
branches:  trunk
changeset: 463912:2acabe811423
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sun Sep 15 15:27:50 2019 +0000

description:
ps(1): Guard freeing the memory of pinfo with __NO_LEAKS.

No more leaks are detected by LSan/NetBSD as of the LLVM snapshot
(clang10svn) from 2019-09-15.

diffstat:

 bin/ps/ps.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r c105c2954ee2 -r 2acabe811423 bin/ps/ps.c
--- a/bin/ps/ps.c       Sun Sep 15 15:19:49 2019 +0000
+++ b/bin/ps/ps.c       Sun Sep 15 15:27:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ps.c,v 1.92 2019/09/11 17:02:53 kamil Exp $    */
+/*     $NetBSD: ps.c,v 1.93 2019/09/15 15:27:50 kamil Exp $    */
 
 /*
  * Copyright (c) 2000-2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 #if 0
 static char sccsid[] = "@(#)ps.c       8.4 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: ps.c,v 1.92 2019/09/11 17:02:53 kamil Exp $");
+__RCSID("$NetBSD: ps.c,v 1.93 2019/09/15 15:27:50 kamil Exp $");
 #endif
 #endif /* not lint */
 
@@ -526,7 +526,9 @@
                }
        }
 
+#ifdef __NO_LEAKS
        free(pinfo);
+#endif
 
        return eval;
 }



Home | Main Index | Thread Index | Old Index