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 | 1e0ea6fe2a8282bbe69e519566b6561f7a52a5aa (patch) | |
tree | 23fe4152b6a4ea07701ae1b0d5d67f79a96942b4 /sysutils | |
parent | f39662c349252c193c9d74ef2eae56e74858bb9c (diff) | |
download | pkgsrc-1e0ea6fe2a8282bbe69e519566b6561f7a52a5aa.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')
-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; |