Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Sync copy fix from ucl.
Vsevolod Stakhov committed 11 years ago
commit 0bbb0d166878ecfaa7cbf74689465068653e2704
parent 067a152
1 file changed +6 -3
modified external/libucl/src/ucl_util.c
@@ -1882,7 +1882,8 @@ ucl_object_copy_internal (const ucl_object_t *other, bool allow_array)
		memcpy (new, other, sizeof (*new));
		new->ref = 1;
		/* Unlink from others */
-
		new->prev = new->next = NULL;
+
		new->next = NULL;
+
		new->prev = new;

		/* deep copy of values stored */
		if (other->trash_stack[UCL_TRASH_KEY] != NULL) {
@@ -1919,8 +1920,10 @@ ucl_object_copy_internal (const ucl_object_t *other, bool allow_array)
		}
		else if (allow_array && other->next != NULL) {
			LL_FOREACH (other->next, cur) {
-
				ucl_object_t *cp = ucl_object_copy_internal (cur, true);
-
				DL_APPEND (new, cp);
+
				ucl_object_t *cp = ucl_object_copy_internal (cur, false);
+
				if (cp != NULL) {
+
					DL_APPEND (new, cp);
+
				}
			}
		}
	}