mirror of
https://github.com/msantos/xmppipe
synced 2024-11-16 00:12:59 +00:00
Check message id has been allocated
This commit is contained in:
parent
04c05bd5f2
commit
550eaf4e59
@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2015, Michael Santos <michael.santos@gmail.com>
|
||||
/* Copyright (c) 2015-2016, Michael Santos <michael.santos@gmail.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@ -1081,6 +1081,10 @@ xmppipe_send_message(xmppipe_state_t *state, char *to, char *type, char *buf,
|
||||
|
||||
id = xmppipe_id_alloc();
|
||||
|
||||
if (id == NULL) {
|
||||
errx(EXIT_FAILURE, "unable to allocate message id");
|
||||
}
|
||||
|
||||
message = xmppipe_stanza_new(state->ctx);
|
||||
xmppipe_stanza_set_name(message, "message");
|
||||
xmppipe_stanza_set_type(message, type);
|
||||
|
Loading…
Reference in New Issue
Block a user