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:
parent
101396ab76
commit
2c7766c28f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user