diff options
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r-- | res/res_jabber.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c index 38b1b5959..ebb1059f5 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -987,8 +987,7 @@ static int aji_act_hook(void *data, int type, iks *node) sprintf(secret, "%s%s", pak->id, client->password); ast_sha1_hash(shasum, secret); handshake = NULL; - asprintf(&handshake, "<handshake>%s</handshake>", shasum); - if (handshake) { + if (asprintf(&handshake, "<handshake>%s</handshake>", shasum) >= 0) { aji_send_raw(client, handshake); ast_free(handshake); handshake = NULL; @@ -2755,8 +2754,7 @@ static int aji_create_client(char *label, struct ast_variable *var, int debug) } if (!strchr(client->user, '/') && !client->component) { /*client */ resource = NULL; - asprintf(&resource, "%s/asterisk", client->user); - if (resource) { + if (asprintf(&resource, "%s/asterisk", client->user) >= 0) { client->jid = iks_id_new(client->stack, resource); ast_free(resource); } @@ -2772,8 +2770,7 @@ static int aji_create_client(char *label, struct ast_variable *var, int debug) } if (!strchr(client->user, '/') && !client->component) { /*client */ resource = NULL; - asprintf(&resource, "%s/asterisk", client->user); - if (resource) { + if (asprintf(&resource, "%s/asterisk", client->user) >= 0) { client->jid = iks_id_new(client->stack, resource); ast_free(resource); } |