Fix res_jabber resource leaks

This should fix almost all resource leaks in res_jabber that involve
ASTOBJ_CONTAINER_FIND and resolves an ambiguous situation where
ast_aji_get_client would sometimes bump an object's refcount and sometimes not.

Review: https://reviewboard.asterisk.org/r/1553
........

Merged revisions 346086 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 346087 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2011-11-23 17:16:33 +00:00
parent 76394a727f
commit e6ca768081
4 changed files with 171 additions and 103 deletions

View File

@@ -213,7 +213,12 @@ int ast_aji_invite_chat(struct aji_client *client, char *user, char *room, char
/*! Join/leave existing Chat session */
int ast_aji_join_chat(struct aji_client *client, char *room, char *nick);
int ast_aji_leave_chat(struct aji_client *client, char *room, char *nick);
/*! Get a client via its name. Increases refcount of client by 1 */
struct aji_client *ast_aji_get_client(const char *name);
struct aji_client_container *ast_aji_get_clients(void);
/*! Destructor function for buddies to be used with ASTOBJ_UNREF */
void ast_aji_buddy_destroy(struct aji_buddy *obj);
/*! Destructor function for clients to be used with ASTOBJ_UNREF after calls to ast_aji_get_client */
void ast_aji_client_destroy(struct aji_client *obj);
#endif