diff options
author | jmmv <jmmv@pkgsrc.org> | 2004-10-19 17:00:56 +0000 |
---|---|---|
committer | jmmv <jmmv@pkgsrc.org> | 2004-10-19 17:00:56 +0000 |
commit | 99252a6393b1327d292a42a0b213c6a537d102f1 (patch) | |
tree | 23fe4152b6a4ea07701ae1b0d5d67f79a96942b4 /sysutils/fam | |
parent | 2c19d8c2162200f561e3761976a22a79cc2bec04 (diff) | |
download | pkgsrc-99252a6393b1327d292a42a0b213c6a537d102f1.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; |