1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

lib: Use talloc_asprintf_addbuf() in str_list_join()

This adds intermediate NULL checks via talloc_asprintf_addbuf()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2022-11-28 10:43:06 +01:00 committed by Jeremy Allison
parent 101396ab76
commit 2c7766c28f

View File

@ -188,7 +188,7 @@ _PUBLIC_ char *str_list_join(TALLOC_CTX *mem_ctx, const char **list, char separa
ret = talloc_strdup(mem_ctx, list[0]);
for (i = 1; list[i]; i++) {
ret = talloc_asprintf_append_buffer(ret, "%c%s", separator, list[i]);
talloc_asprintf_addbuf(&ret, "%c%s", separator, list[i]);
}
return ret;