From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Tue, 2 Oct 2018 11:36:58 +0000 (+0100) Subject: string list: Need to strdup return value on remove first. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b57d9dbe7e811255a38b812b93275acedad57835;p=thirdparty%2Ftvheadend.git 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. --- 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;