pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/fam/files Remove a memory leak that was suppo...
details: https://anonhg.NetBSD.org/pkgsrc/rev/3ed9c9a55a67
branches: trunk
changeset: 482075:3ed9c9a55a67
user: jmmv <jmmv%pkgsrc.org@localhost>
date: Tue Oct 19 17:00:56 2004 +0000
description:
Remove a memory leak that was supposed to fix a bug (but the bug is not
really there... i.e., me not reading the code properly). Not bumping
revision since this affects the kqueue part only, which is not built by
default.
diffstat:
sysutils/fam/files/IMonKQueue.c++ | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diffs (26 lines):
diff -r 249fce9d952a -r 3ed9c9a55a67 sysutils/fam/files/IMonKQueue.c++
--- a/sysutils/fam/files/IMonKQueue.c++ Tue Oct 19 16:46:54 2004 +0000
+++ b/sysutils/fam/files/IMonKQueue.c++ Tue Oct 19 17:00:56 2004 +0000
@@ -1,4 +1,4 @@
-// $NetBSD: IMonKQueue.c++,v 1.1 2004/10/17 19:20:53 jmmv Exp $
+// $NetBSD: IMonKQueue.c++,v 1.2 2004/10/19 17:00:56 jmmv Exp $
//
// Copyright (c) 2004 Julio M. Merino Vidal.
//
@@ -207,13 +207,9 @@
IMon::imon_express(const char *name, struct stat *status)
{
// Get file information.
- if (status == NULL) {
- // XXX This leaks memory. AFAICT, the code calling this function
- // expects status to be filled if it was NULL. If this is true,
- // the code in IMonLinux does worse than us, because it returns a
- // pointer to a local variable...
- status = new struct stat;
- }
+ struct stat sb;
+ if (status == NULL)
+ status = &sb;
if (lstat(name, status) == -1)
return BAD;
Home |
Main Index |
Thread Index |
Old Index