util/process: document memory leak
authorEric Engestrom <eric.engestrom@intel.com>
Fri, 22 Mar 2019 16:54:57 +0000 (16:54 +0000)
committerEric Engestrom <eric@engestrom.ch>
Thu, 4 Apr 2019 16:09:52 +0000 (16:09 +0000)
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@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/util/u_process.c

index a1667e78074d3c8b1da670a746d79486b7cf14ba..94c975df39610f1aec7354a5bbf668bdb33729a0 100644 (file)
@@ -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) {