From b57d9dbe7e811255a38b812b93275acedad57835 Mon Sep 17 00:00:00 2001 From: "E.Smith" <31170571+azlm8t@users.noreply.github.com> Date: Tue, 2 Oct 2018 12:36:58 +0100 Subject: [PATCH] string list: Need to strdup return value on remove first. The id is part of the buffer itself (rather than separately allocated), so need to strdup the id when returning first element. --- src/string_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string_list.c b/src/string_list.c index 000d9cc9d..2d851bf28 100644 --- a/src/string_list.c +++ b/src/string_list.c @@ -58,7 +58,7 @@ string_list_remove_first(string_list_t *l) string_list_item_t *item = RB_FIRST(l); if (!item) return NULL; - ret = item->id; + ret = strdup(item->id); RB_REMOVE(l, item, h_link); free(item); return ret; -- 2.47.2