summaryrefslogtreecommitdiff
path: root/sysutils/fam
diff options
context:
space:
mode:
authorjmmv <jmmv>2004-10-19 17:00:56 +0000
committerjmmv <jmmv>2004-10-19 17:00:56 +0000
commit839ac3f12139ae5409076d7975adf0746caae1cc (patch)
tree23fe4152b6a4ea07701ae1b0d5d67f79a96942b4 /sysutils/fam
parent182090a64677e3f2bd3d8c0f55b13a389b19e330 (diff)
downloadpkgsrc-839ac3f12139ae5409076d7975adf0746caae1cc.tar.gz
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 (limited to 'sysutils/fam')
-rw-r--r--sysutils/fam/files/IMonKQueue.c++12
1 files changed, 4 insertions, 8 deletions
diff --git a/sysutils/fam/files/IMonKQueue.c++ b/sysutils/fam/files/IMonKQueue.c++
index 17da4d9cb6e..25d55f9b174 100644
--- a/sysutils/fam/files/IMonKQueue.c++
+++ b/sysutils/fam/files/IMonKQueue.c++
@@ -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::Status
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;