projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: use zmalloc in lttng enable_events.c
[lttng-tools.git]
/
src
/
bin
/
lttng
/
commands
/
enable_events.c
diff --git
a/src/bin/lttng/commands/enable_events.c
b/src/bin/lttng/commands/enable_events.c
index 11eebc022d8085fd56a4ece4edcf8f0d3e5e02b6..c15edf5fd3deaaeeba49fc86345180475588d288 100644
(file)
--- a/
src/bin/lttng/commands/enable_events.c
+++ b/
src/bin/lttng/commands/enable_events.c
@@
-422,7
+422,10
@@
char *print_exclusions(int count, char **names)
/* add length of preamble + one for NUL - one for last (missing) comma */
length += strlen(preamble);
/* add length of preamble + one for NUL - one for last (missing) comma */
length += strlen(preamble);
- ret = malloc(length);
+ ret = zmalloc(length);
+ if (!ret) {
+ return NULL;
+ }
strncpy(ret, preamble, length);
for (i = 0; i < count; i++) {
strcat(ret, names[i]);
strncpy(ret, preamble, length);
for (i = 0; i < count; i++) {
strcat(ret, names[i]);
This page took
0.040528 seconds
and
4
git commands to generate.