aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_jabber.c
diff options
context:
space:
mode:
authormogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-01 08:22:44 +0000
committermogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-01 08:22:44 +0000
commita886139b21dba0216790453a13bd816228bf13ad (patch)
treebd4f6a8456b03ab8664f78c620cb33fd56c3b588 /res/res_jabber.c
parent2a85082c9026429b2baa7dd856fdd7f785cac7f0 (diff)
solves bug where reload deleted things it shouldnt have
and adds check into jabberstatus so it cant segfault. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31298 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r--res/res_jabber.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 16ac8c61a..71a60552d 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -332,7 +332,11 @@ static int aji_status_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Could not find Connection.\n");
return -1;
}
-
+
+ if(!&client->buddies) {
+ ast_log(LOG_WARNING, "No buddies for connection.\n");
+ return -1;
+ }
ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, {
ASTOBJ_RDLOCK(iterator);
if (!strcasecmp(iterator->user, screenname)) {
@@ -2057,6 +2061,7 @@ static int aji_create_transport(char *label, struct aji_client *client)
}
}
ASTOBJ_UNLOCK(buddy);
+ ASTOBJ_UNMARK(buddy);
ASTOBJ_CONTAINER_LINK(&client->buddies, buddy);
return 0;
}
@@ -2088,8 +2093,10 @@ static int aji_create_buddy(char *label, struct aji_client *client)
ASTOBJ_UNLOCK(buddy);
if(flag)
ASTOBJ_CONTAINER_LINK(&client->buddies, buddy);
- else
+ else {
+ ASTOBJ_UNMARK(buddy);
ASTOBJ_UNREF(buddy, aji_buddy_destroy);
+ }
return 1;
}