Fix dictionary crash walkthrough empty (#13051)
fix dictionary walkthrouhg crash when the dictionary is empty
Costa Tsaousis committed
Jun 2, 2022 at 00:59 UTC
228a2d0aea0209adde50ff92c9801dcb8fb8fbea
1 file changed
+1
-1
libnetdata/dictionary/dictionary.c
+1
-1
@@ -902,7 +902,7 @@ int dictionary_walkthrough_rw(DICTIONARY *dict, char rw, int (*callback)(const c
902
// written in such a way, that the callback can delete the active element
903
904
int ret = 0;
905
- NAME_VALUE *nv = dict->first_item, *nv_next = nv->next;
905
+ NAME_VALUE *nv = dict->first_item, *nv_next;
906
while(nv) {
907
nv_next = nv->next;
908