Mesa (master): util/process: document memory leak

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 4 16:11:58 UTC 2019


Module: Mesa
Branch: master
Commit: d1dd3cbcc766a70ec3b193201299792566c6b69a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1dd3cbcc766a70ec3b193201299792566c6b69a

Author: Eric Engestrom <eric.engestrom at intel.com>
Date:   Fri Mar 22 16:54:57 2019 +0000

util/process: document memory leak

We consider it acceptable, but let's still document it in case people
notice it and are not sure why it's there.

Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/util/u_process.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/util/u_process.c b/src/util/u_process.c
index a1667e78074..94c975df396 100644
--- a/src/util/u_process.c
+++ b/src/util/u_process.c
@@ -52,6 +52,10 @@ __getProgramName()
       static char *path;
 
       if (!path)
+         /* Note: realpath() allocates memory that we will keep around for
+          * the lifetime of the app, and then leak as the app closes.
+          * FIXME: we should find a way to clean this properly
+          */
          path = realpath("/proc/self/exe", NULL);
 
       if (path && strncmp(path, program_invocation_name, strlen(path)) == 0) {




More information about the mesa-commit mailing list