uci: fix atomicity of uci_add_list
authorJan Venekamp <jan@venekamp.net>
Sun, 20 Nov 2022 01:08:24 +0000 (02:08 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 4 Mar 2023 18:39:32 +0000 (19:39 +0100)
commit74f2797fca21fee456ca669e61dfde4e031c3db8
treecda49840b0705edf80707d862d89ee06908d1f3e
parent47697e6579be2c9f4cfc51eec1d35d453c3c7c5e
uci: fix atomicity of uci_add_list

The function uci_add_list is not atomic, when an alloc inside
uci_add_element_list fails the option can be left in an indeterminate
state.

Refactor uci_add_list to fix this and make the code flow easier to
read.

Signed-off-by: Jan Venekamp <jan@venekamp.net>
list.c