projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: add null checks before "casting" to "base class"
[babeltrace.git]
/
src
/
lib
/
error.c
diff --git
a/src/lib/error.c
b/src/lib/error.c
index 9144bd96ddc528c9f52e47afe88d0c195bd678ed..bd8259ab71057103385d75b711ffd59a5508007a 100644
(file)
--- a/
src/lib/error.c
+++ b/
src/lib/error.c
@@
-300,8
+300,10
@@
struct bt_error_cause_component_actor *create_error_cause_component_actor(
goto end;
error:
goto end;
error:
- destroy_error_cause(&cause->base);
- cause = NULL;
+ if (cause) {
+ destroy_error_cause(&cause->base);
+ cause = NULL;
+ }
end:
return cause;
end:
return cause;
@@
-341,8
+343,10
@@
create_error_cause_component_class_actor(struct bt_component_class *comp_cls,
goto end;
error:
goto end;
error:
- destroy_error_cause(&cause->base);
- cause = NULL;
+ if (cause) {
+ destroy_error_cause(&cause->base);
+ cause = NULL;
+ }
end:
return cause;
end:
return cause;
@@
-407,8
+411,10
@@
create_error_cause_message_iterator_actor(struct bt_message_iterator *iter,
goto end;
error:
goto end;
error:
- destroy_error_cause(&cause->base);
- cause = NULL;
+ if (cause) {
+ destroy_error_cause(&cause->base);
+ cause = NULL;
+ }
end:
return cause;
end:
return cause;
@@
-523,7
+529,10
@@
int bt_error_append_cause_from_component(
cause = NULL;
end:
cause = NULL;
end:
- destroy_error_cause(&cause->base);
+ if (cause) {
+ destroy_error_cause(&cause->base);
+ }
+
return status;
}
return status;
}
@@
-557,7
+566,10
@@
int bt_error_append_cause_from_component_class(
cause = NULL;
end:
cause = NULL;
end:
- destroy_error_cause(&cause->base);
+ if (cause) {
+ destroy_error_cause(&cause->base);
+ }
+
return status;
}
return status;
}
@@
-590,7
+602,10
@@
int bt_error_append_cause_from_message_iterator(
cause = NULL;
end:
cause = NULL;
end:
- destroy_error_cause(&cause->base);
+ if (cause) {
+ destroy_error_cause(&cause->base);
+ }
+
return status;
}
return status;
}
This page took
0.025721 seconds
and
4
git commands to generate.