exit_remote_server: avoid clang static analysis warning
if IsServer(source_p) then the following must be all non-NULL: ->serv ->servptr ->servptr->serv Remove unnecessary and inconsistent pointer checks.
This commit is contained in:
parent
630c15211d
commit
6c1e15a432
2 changed files with 4 additions and 8 deletions
|
@ -1412,13 +1412,9 @@ exit_remote_server(struct Client *client_p, struct Client *source_p, struct Clie
|
|||
snprintf(newcomment, sizeof(newcomment), "by %s: %s",
|
||||
from->name, comment);
|
||||
|
||||
if(source_p->serv != NULL)
|
||||
remove_dependents(client_p, source_p, from, IsPerson(from) ? newcomment : comment, comment1);
|
||||
|
||||
if(source_p->servptr && source_p->servptr->serv)
|
||||
rb_dlinkDelete(&source_p->lnode, &source_p->servptr->serv->servers);
|
||||
else
|
||||
s_assert(0);
|
||||
|
||||
rb_dlinkFindDestroy(source_p, &global_serv_list);
|
||||
target_p = source_p->from;
|
||||
|
@ -1436,6 +1432,7 @@ exit_remote_server(struct Client *client_p, struct Client *source_p, struct Clie
|
|||
|
||||
del_from_client_hash(source_p->name, source_p);
|
||||
remove_client_from_list(source_p);
|
||||
|
||||
scache_split(source_p->serv->nameinfo);
|
||||
|
||||
SetDead(source_p);
|
||||
|
|
|
@ -860,8 +860,6 @@ server_estab(struct Client *client_p)
|
|||
|
||||
sendto_one(client_p, "SVINFO %d %d 0 :%ld", TS_CURRENT, TS_MIN, (long int)rb_current_time());
|
||||
|
||||
SetServer(client_p);
|
||||
|
||||
rb_dlinkAdd(client_p, &client_p->lnode, &me.serv->servers);
|
||||
rb_dlinkMoveNode(&client_p->localClient->tnode, &unknown_list, &serv_list);
|
||||
rb_dlinkAddTailAlloc(client_p, &global_serv_list);
|
||||
|
@ -872,6 +870,7 @@ server_estab(struct Client *client_p)
|
|||
add_to_client_hash(client_p->name, client_p);
|
||||
/* doesnt duplicate client_p->serv if allocated this struct already */
|
||||
make_server(client_p);
|
||||
SetServer(client_p);
|
||||
|
||||
client_p->serv->caps = client_p->localClient->caps;
|
||||
|
||||
|
|
Loading…
Reference in a new issue