diff --git a/repos/libports/include/libc-plugin/fd_alloc.h b/repos/libports/include/libc-plugin/fd_alloc.h index c906fd5442..b3c0a02cb9 100644 --- a/repos/libports/include/libc-plugin/fd_alloc.h +++ b/repos/libports/include/libc-plugin/fd_alloc.h @@ -49,6 +49,7 @@ namespace Libc { void path(char const *newpath) { + if (fd_path) { Genode::warning("may leak former FD path memory"); } if (newpath) { Genode::size_t const path_size = ::strlen(newpath) + 1; char *buf = (char*)malloc(path_size); diff --git a/repos/libports/src/lib/libc/vfs_plugin.h b/repos/libports/src/lib/libc/vfs_plugin.h index 389ef5c657..10e583b75e 100644 --- a/repos/libports/src/lib/libc/vfs_plugin.h +++ b/repos/libports/src/lib/libc/vfs_plugin.h @@ -66,6 +66,7 @@ class Libc::Vfs_plugin : public Libc::Plugin * We have to allocate the path from the libc (done via 'strdup') * such that the path can be freed when an stdio fd is closed. */ + if (fd->fd_path) { Genode::warning("may leak former FD path memory"); } fd->fd_path = strdup(path.string()); } catch (Xml_node::Nonexistent_attribute) { }