projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix memory leak in create command
[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 99e5daa932511bd0b891a773df2be7dc5399a55d..3a4b6f30ff826b3b72b971719b0f4a42d3cc0b1d 100644
(file)
--- a/
src/bin/lttng/commands/create.c
+++ b/
src/bin/lttng/commands/create.c
@@
-101,9
+101,8
@@
static int create_session()
goto error;
}
goto error;
}
- ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME
- "/%s-%s", alloc_path, session_name, datetime);
-
+ ret = asprintf(&traces_path, "%s/" DEFAULT_TRACE_DIR_NAME "/%s-%s",
+ alloc_path, session_name, datetime);
if (ret < 0) {
perror("asprintf trace dir name");
ret = CMD_ERROR;
if (ret < 0) {
perror("asprintf trace dir name");
ret = CMD_ERROR;
@@
-132,6
+131,10
@@
static int create_session()
ret = CMD_SUCCESS;
error:
ret = CMD_SUCCESS;
error:
+ if (opt_session_name == NULL) {
+ free(session_name);
+ }
+
if (alloc_path) {
free(alloc_path);
}
if (alloc_path) {
free(alloc_path);
}
This page took
0.040506 seconds
and
5
git commands to generate.