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@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
Eric Engestrom 2019-03-22 16:54:57 +00:00 committed by Eric Engestrom
parent 05b114e526
commit d1dd3cbcc7
1 changed files with 4 additions and 0 deletions

View 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) {