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-ctl: use zmalloc(), missing OOM check
[lttng-tools.git]
/
src
/
lib
/
lttng-ctl
/
lttng-ctl.c
diff --git
a/src/lib/lttng-ctl/lttng-ctl.c
b/src/lib/lttng-ctl/lttng-ctl.c
index 017dd6bbaf310e2afd7b156c48883a81fb13a461..50782c4eff86e7dbf4b7b125ffe2b61cbcfffd31 100644
(file)
--- a/
src/lib/lttng-ctl/lttng-ctl.c
+++ b/
src/lib/lttng-ctl/lttng-ctl.c
@@
-222,7
+222,7
@@
int lttng_check_tracing_group(void)
}
/* Alloc group list of the right size */
}
/* Alloc group list of the right size */
- grp_list = malloc(grp_list_size * sizeof(gid_t));
+ grp_list =
z
malloc(grp_list_size * sizeof(gid_t));
if (!grp_list) {
perror("malloc");
goto end;
if (!grp_list) {
perror("malloc");
goto end;
@@
-442,7
+442,11
@@
int lttng_ctl_ask_sessiond_varlen(struct lttcomm_session_msg *lsm,
goto end;
}
goto end;
}
- data = (void*) malloc(size);
+ data = zmalloc(size);
+ if (!data) {
+ ret = -ENOMEM;
+ goto end;
+ }
/* Get payload data */
ret = recv_data_sessiond(data, size);
/* Get payload data */
ret = recv_data_sessiond(data, size);
@@
-482,7
+486,7
@@
struct lttng_handle *lttng_create_handle(const char *session_name,
goto end;
}
goto end;
}
- handle = malloc(sizeof(struct lttng_handle));
+ handle =
z
malloc(sizeof(struct lttng_handle));
if (handle == NULL) {
PERROR("malloc handle");
goto end;
if (handle == NULL) {
PERROR("malloc handle");
goto end;
This page took
0.024381 seconds
and
4
git commands to generate.