Skip to content

Commit 7b53ddd

Browse files
committed
arguably functions calling talloc_free() should return int
and the callers should check the return code
1 parent 2739bda commit 7b53ddd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib/util/dlist.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,19 +832,21 @@ static inline CC_HINT(nonnull) int fr_dlist_move_head(fr_dlist_head_t *list_dst,
832832
/** Free the first item in the list
833833
*
834834
* @param[in] list_head to free head item in.
835+
* @return result of talloc_free
835836
*/
836-
static inline void fr_dlist_talloc_free_head(fr_dlist_head_t *list_head)
837+
static inline int fr_dlist_talloc_free_head(fr_dlist_head_t *list_head)
837838
{
838-
talloc_free(fr_dlist_pop_head(list_head));
839+
return talloc_free(fr_dlist_pop_head(list_head));
839840
}
840841

841842
/** Free the last item in the list
842843
*
843844
* @param[in] list_head to free tail item in.
845+
* @return result of talloc_free
844846
*/
845-
static inline void fr_dlist_talloc_free_tail(fr_dlist_head_t *list_head)
847+
static inline int fr_dlist_talloc_free_tail(fr_dlist_head_t *list_head)
846848
{
847-
talloc_free(fr_dlist_pop_tail(list_head));
849+
return talloc_free(fr_dlist_pop_tail(list_head));
848850
}
849851

850852
/** Free the item specified

0 commit comments

Comments
 (0)