projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: filter bytecode and string memory leak on error
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
main.c
diff --git
a/src/bin/lttng-sessiond/main.c
b/src/bin/lttng-sessiond/main.c
index c8484b93cb8a7006b708f562466cffc75aa4c767..81b5e942705d0404673bedaf13695b5f4524332d 100644
(file)
--- a/
src/bin/lttng-sessiond/main.c
+++ b/
src/bin/lttng-sessiond/main.c
@@
-18,6
+18,7
@@
*/
#define _GNU_SOURCE
*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <getopt.h>
#include <grp.h>
#include <limits.h>
#include <getopt.h>
#include <grp.h>
#include <limits.h>
@@
-3217,12
+3218,14
@@
skip_domain:
if (bytecode_len > LTTNG_FILTER_MAX_LEN) {
ret = LTTNG_ERR_FILTER_INVAL;
if (bytecode_len > LTTNG_FILTER_MAX_LEN) {
ret = LTTNG_ERR_FILTER_INVAL;
+ free(filter_expression);
free(exclusion);
goto error;
}
bytecode = zmalloc(bytecode_len);
if (!bytecode) {
free(exclusion);
goto error;
}
bytecode = zmalloc(bytecode_len);
if (!bytecode) {
+ free(filter_expression);
free(exclusion);
ret = LTTNG_ERR_FILTER_NOMEM;
goto error;
free(exclusion);
ret = LTTNG_ERR_FILTER_NOMEM;
goto error;
@@
-3234,6
+3237,7
@@
skip_domain:
if (ret <= 0) {
DBG("Nothing recv() from client car len data... continuing");
*sock_error = 1;
if (ret <= 0) {
DBG("Nothing recv() from client car len data... continuing");
*sock_error = 1;
+ free(filter_expression);
free(bytecode);
free(exclusion);
ret = LTTNG_ERR_FILTER_INVAL;
free(bytecode);
free(exclusion);
ret = LTTNG_ERR_FILTER_INVAL;
@@
-3241,6
+3245,7
@@
skip_domain:
}
if ((bytecode->len + sizeof(*bytecode)) != bytecode_len) {
}
if ((bytecode->len + sizeof(*bytecode)) != bytecode_len) {
+ free(filter_expression);
free(bytecode);
free(exclusion);
ret = LTTNG_ERR_FILTER_INVAL;
free(bytecode);
free(exclusion);
ret = LTTNG_ERR_FILTER_INVAL;
@@
-3501,7
+3506,7
@@
skip_domain:
case LTTNG_LIST_CHANNELS:
{
int nb_chan;
case LTTNG_LIST_CHANNELS:
{
int nb_chan;
- struct lttng_channel *channels;
+ struct lttng_channel *channels
= NULL
;
nb_chan = cmd_list_channels(cmd_ctx->lsm->domain.type,
cmd_ctx->session, &channels);
nb_chan = cmd_list_channels(cmd_ctx->lsm->domain.type,
cmd_ctx->session, &channels);
This page took
0.026752 seconds
and
4
git commands to generate.