projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: test presence of override_attr before accessing its member
[lttng-tools.git]
/
src
/
lib
/
lttng-ctl
/
load.c
diff --git
a/src/lib/lttng-ctl/load.c
b/src/lib/lttng-ctl/load.c
index b396b7500f913133963a1360fbaa439bf9844f9e..f89effed04b8b69b23e186dfee6237e8b8cfe10d 100644
(file)
--- a/
src/lib/lttng-ctl/load.c
+++ b/
src/lib/lttng-ctl/load.c
@@
-94,10
+94,12
@@
const char *lttng_load_session_attr_get_override_ctrl_url(
{
const char *ret = NULL;
{
const char *ret = NULL;
- if (
attr && attr->override_attr->ctrl_url
) {
-
ret = attr->raw_override_ctrl_url
;
+ if (
!attr || !attr->override_attr
) {
+
goto end
;
}
}
+ ret = attr->raw_override_ctrl_url;
+end:
return ret;
}
return ret;
}
@@
-106,10
+108,12
@@
const char *lttng_load_session_attr_get_override_data_url(
{
const char *ret = NULL;
{
const char *ret = NULL;
- if (
attr && attr->override_attr->data_url
) {
-
ret = attr->raw_override_data_url
;
+ if (
!attr || !attr->override_attr
) {
+
goto end
;
}
}
+ ret = attr->raw_override_data_url;
+end:
return ret;
}
return ret;
}
@@
-118,12
+122,16
@@
const char *lttng_load_session_attr_get_override_url(
{
const char *ret = NULL;
{
const char *ret = NULL;
- if (attr && (attr->override_attr->path_url ||
+ if (!attr || !attr->override_attr) {
+ goto end;
+ }
+
+ if ((attr->override_attr->path_url ||
(attr->override_attr->ctrl_url &&
attr->override_attr->data_url))) {
ret = attr->raw_override_url;
}
(attr->override_attr->ctrl_url &&
attr->override_attr->data_url))) {
ret = attr->raw_override_url;
}
-
+end:
return ret;
}
return ret;
}
This page took
0.024609 seconds
and
4
git commands to generate.