# HG changeset patch # User Timo Sirainen # Date 1481512588 -7200 # Node ID d80f9583a9eccc995dc6a44965508e42d96a6e89 # Parent 1bdfc555f6a3e35c8be4298757ca3382d6e4dffb lib: Optimization - p_strconcat() doesn't need to allocate from data stack Various other parts of the code already rely on p_malloc() not overwriting t_buffer_get()'ed data. p_strconcat() can do that as well. diff -r 1bdfc555f6a3 -r d80f9583a9ec src/lib/strfuncs.c --- a/src/lib/strfuncs.c Mon Dec 12 04:55:47 2016 +0200 +++ b/src/lib/strfuncs.c Mon Dec 12 05:16:28 2016 +0200 @@ -213,16 +213,9 @@ if (ret != NULL) t_buffer_alloc(len); } else { - T_BEGIN { - temp = vstrconcat(str1, args, &len); - if (temp == NULL) - ret = NULL; - else { - t_buffer_alloc(len); - ret = p_malloc(pool, len); - memcpy(ret, temp, len); - } - } T_END; + temp = vstrconcat(str1, args, &len); + ret = p_malloc(pool, len); + memcpy(ret, temp, len); } va_end(args);