Change in libosmocore[master]: write_queue: Document it that caller is responsible if enqueue fails

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Nov 25 12:56:01 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26361 )

Change subject: write_queue: Document it that caller is responsible if enqueue fails
......................................................................

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
---
M src/write_queue.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  daniel: Looks good to me, approved



diff --git a/src/write_queue.c b/src/write_queue.c
index b208b25..31b8427 100644
--- a/src/write_queue.c
+++ b/src/write_queue.c
@@ -106,7 +106,7 @@
 /*! 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 @@
 /*! 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)
 {

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26361
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I7e61c19d32a75e28f08b74a8e3d9d63a2d8bf3d7
Gerrit-Change-Number: 26361
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211125/032979fd/attachment.htm>


More information about the gerrit-log mailing list