mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 13:27:09 +02:00
fixes: object.h:141:26: error: null pointer dereference [-Werror=null-dereference] 141 | if (child->parent) { | ~~~~~^~~~~~~~ object.h:141:26: error: null pointer dereference [-Werror=null-dereference] cc1: all warnings being treated as errors
23 lines
585 B
Diff
23 lines
585 B
Diff
diff --git a/src/ctf-writer/object.h b/src/ctf-writer/object.h
|
|
index 70032c2..9e4552a 100644
|
|
--- a/src/ctf-writer/object.h
|
|
+++ b/src/ctf-writer/object.h
|
|
@@ -138,11 +138,13 @@ void bt_ctf_object_set_parent(struct bt_ctf_object *child, struct bt_ctf_object
|
|
child->parent = parent;
|
|
bt_ctf_object_get_no_null_check(parent);
|
|
} else {
|
|
- if (child->parent) {
|
|
- bt_ctf_object_put_no_null_check(child->parent);
|
|
- }
|
|
+ if (child) {
|
|
+ if (child->parent) {
|
|
+ bt_ctf_object_put_no_null_check(child->parent);
|
|
+ }
|
|
|
|
- child->parent = NULL;
|
|
+ child->parent = NULL;
|
|
+ }
|
|
}
|
|
}
|
|
|