projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: missing strdup oom check in lttng create.c
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
create.c
diff --git
a/src/bin/lttng/commands/create.c
b/src/bin/lttng/commands/create.c
index 1fa6d418b4ff439c297e08d00bd40f9fff0a1f62..1ebe590ad279915e8e3e7ba05784e0333eb9064f 100644
(file)
--- a/
src/bin/lttng/commands/create.c
+++ b/
src/bin/lttng/commands/create.c
@@
-377,16
+377,22
@@
static int create_session(void)
*/
url = NULL;
} else if (!opt_no_output) {
*/
url = NULL;
} else if (!opt_no_output) {
+ char *tmp_path;
+
/* Auto output path */
/* Auto output path */
-
alloc
_path = utils_get_home_dir();
- if (
alloc
_path == NULL) {
+
tmp
_path = utils_get_home_dir();
+ if (
tmp
_path == NULL) {
ERR("HOME path not found.\n \
Please specify an output path using -o, --output PATH");
ret = CMD_FATAL;
goto error;
}
ERR("HOME path not found.\n \
Please specify an output path using -o, --output PATH");
ret = CMD_FATAL;
goto error;
}
- alloc_path = strdup(alloc_path);
-
+ alloc_path = strdup(tmp_path);
+ if (!alloc_path) {
+ PERROR("allocating alloc_path");
+ ret = CMD_FATAL;
+ goto error;
+ }
ret = asprintf(&alloc_url,
"file://%s/" DEFAULT_TRACE_DIR_NAME "/%s",
alloc_path, session_name_date);
ret = asprintf(&alloc_url,
"file://%s/" DEFAULT_TRACE_DIR_NAME "/%s",
alloc_path, session_name_date);
This page took
0.024377 seconds
and
4
git commands to generate.