avoid following NULL pointers

This commit is contained in:
Wim Taymans 2020-05-20 13:41:48 +02:00
parent a898f21c87
commit a19bab4b16
5 changed files with 25 additions and 20 deletions

View file

@ -430,8 +430,8 @@ static int rescan_endpoint(struct impl *impl, struct endpoint *ep)
if ((obj = sm_media_session_find_object(impl->session, path_id)) != NULL) {
if (strcmp(obj->type, PW_TYPE_INTERFACE_Endpoint) == 0) {
peer = sm_object_get_data(obj, SESSION_KEY);
goto do_link;
if ((peer = sm_object_get_data(obj, SESSION_KEY)) != NULL)
goto do_link;
}
else if (strcmp(obj->type, PW_TYPE_INTERFACE_Node) == 0) {
node = (struct sm_node*)obj;

View file

@ -490,7 +490,8 @@ static void object_update(void *data)
node->obj->obj.avail & SM_OBJECT_CHANGE_MASK_PROPERTIES)
node->endpoint = create_endpoint(node);
if (node->obj->obj.changed & SM_NODE_CHANGE_MASK_PARAMS)
if (node->endpoint &&
node->obj->obj.changed & SM_NODE_CHANGE_MASK_PARAMS)
update_params(node->endpoint);
}