solves bug where reload deleted things it shouldnt have
and adds check into jabberstatus so it cant segfault. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@31298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
8cfb992c1e
commit
073e346f4e
|
@ -333,6 +333,10 @@ static int aji_status_exec(struct ast_channel *chan, void *data)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!&client->buddies) {
|
||||||
|
ast_log(LOG_WARNING, "No buddies for connection.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, {
|
ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, {
|
||||||
ASTOBJ_RDLOCK(iterator);
|
ASTOBJ_RDLOCK(iterator);
|
||||||
if (!strcasecmp(iterator->user, screenname)) {
|
if (!strcasecmp(iterator->user, screenname)) {
|
||||||
|
@ -2057,6 +2061,7 @@ static int aji_create_transport(char *label, struct aji_client *client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ASTOBJ_UNLOCK(buddy);
|
ASTOBJ_UNLOCK(buddy);
|
||||||
|
ASTOBJ_UNMARK(buddy);
|
||||||
ASTOBJ_CONTAINER_LINK(&client->buddies, buddy);
|
ASTOBJ_CONTAINER_LINK(&client->buddies, buddy);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2088,8 +2093,10 @@ static int aji_create_buddy(char *label, struct aji_client *client)
|
||||||
ASTOBJ_UNLOCK(buddy);
|
ASTOBJ_UNLOCK(buddy);
|
||||||
if(flag)
|
if(flag)
|
||||||
ASTOBJ_CONTAINER_LINK(&client->buddies, buddy);
|
ASTOBJ_CONTAINER_LINK(&client->buddies, buddy);
|
||||||
else
|
else {
|
||||||
|
ASTOBJ_UNMARK(buddy);
|
||||||
ASTOBJ_UNREF(buddy, aji_buddy_destroy);
|
ASTOBJ_UNREF(buddy, aji_buddy_destroy);
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue