mirror of https://gerrit.osmocom.org/libosmocore
write_queue: Document it that caller is responsible if enqueue fails
This kind of API will likely cause memory leaks in case the caller fails to check the return value of the function and knows he must free the message. Change-Id: I7e61c19d32a75e28f08b74a8e3d9d63a2d8bf3d7 Related: OS#5329
This commit is contained in:
parent
9a9627ec36
commit
e352715eb1
|
@ -106,7 +106,7 @@ void osmo_wqueue_init(struct osmo_wqueue *queue, int max_length)
|
|||
/*! Enqueue a new \ref msgb into a write queue (without logging full queue events)
|
||||
* \param[in] queue Write queue to be used
|
||||
* \param[in] data to-be-enqueued message buffer
|
||||
* \returns 0 on success; negative on error
|
||||
* \returns 0 on success; negative on error (MESSAGE NOT FREED IN CASE OF ERROR).
|
||||
*/
|
||||
int osmo_wqueue_enqueue_quiet(struct osmo_wqueue *queue, struct msgb *data)
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ int osmo_wqueue_enqueue_quiet(struct osmo_wqueue *queue, struct msgb *data)
|
|||
/*! Enqueue a new \ref msgb into a write queue
|
||||
* \param[in] queue Write queue to be used
|
||||
* \param[in] data to-be-enqueued message buffer
|
||||
* \returns 0 on success; negative on error
|
||||
* \returns 0 on success; negative on error (MESSAGE NOT FREED IN CASE OF ERROR).
|
||||
*/
|
||||
int osmo_wqueue_enqueue(struct osmo_wqueue *queue, struct msgb *data)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue