summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-03-22 16:54:57 +0000
committerEric Engestrom <[email protected]>2019-04-04 16:09:52 +0000
commitd1dd3cbcc766a70ec3b193201299792566c6b69a (patch)
treea3956938d280d6ce023b9c8f8e18624a912113cc /src/util
parent05b114e5265722e970cb894ed6c3aa3026c0d04d (diff)
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 <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/u_process.c4
1 files changed, 4 insertions, 0 deletions
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) {