From ec7ef06ebab243809679f3f643730f5755331514 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 12:18:07 -0500 Subject: [PATCH] Fix: add missing str*dup oom check in sessiond main.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 590df85b6..e69ae0d45 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -5104,6 +5104,10 @@ int main(int argc, char **argv) if (is_root) { rundir = strdup(DEFAULT_LTTNG_RUNDIR); + if (!rundir) { + ret = -ENOMEM; + goto error; + } /* Create global run dir with root access */ ret = create_lttng_rundir(rundir); -- 2.34.1