projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: lttng-add-context: leak of application context parameters
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
add_context.cpp
diff --git
a/src/bin/lttng/commands/add_context.cpp
b/src/bin/lttng/commands/add_context.cpp
index cc5e487df3b8b0d8398c32a7c229af07f061f4c9..550015f171cb6331b1c92143789df5dba79ea30d 100644
(file)
--- a/
src/bin/lttng/commands/add_context.cpp
+++ b/
src/bin/lttng/commands/add_context.cpp
@@
-812,9
+812,16
@@
static void destroy_ctx_type(struct ctx_type *type)
if (!type) {
return;
}
if (!type) {
return;
}
+
if (type->opt) {
free(type->opt->symbol);
}
if (type->opt) {
free(type->opt->symbol);
}
+
+ if (type->opt->ctx_type == CONTEXT_APP_CONTEXT) {
+ free(type->opt->u.app_ctx.ctx_name);
+ free(type->opt->u.app_ctx.provider_name);
+ }
+
delete type->opt;
free(type);
}
delete type->opt;
free(type);
}
@@
-976,7
+983,7
@@
static struct ctx_type *get_context_type(const char *ctx)
}
/* String starts with $app. */
}
/* String starts with $app. */
- if (strncmp(ctx, app_ctx_prefix, sizeof(app_ctx_prefix) - 1)) {
+ if (strncmp(ctx, app_ctx_prefix, sizeof(app_ctx_prefix) - 1)
!= 0
) {
goto not_found;
}
goto not_found;
}
This page took
0.023728 seconds
and
4
git commands to generate.