From: Kevin P. Fleming Date: Mon, 16 Feb 2009 21:41:46 +0000 (+0000) Subject: correct a logic error in the last stringfields commit... don't mark additional space... X-Git-Tag: 1.4.24-rc1~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d808232cffed33c396a871cc93d45881b020557;p=thirdparty%2Fasterisk.git correct a logic error in the last stringfields commit... don't mark additional space as allocated if the string was built using already-allocated space git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176254 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/utils.c b/main/utils.c index 84d53e182e..3d3da881ca 100644 --- a/main/utils.c +++ b/main/utils.c @@ -1298,9 +1298,11 @@ void __ast_string_field_index_build_va(struct ast_string_field_mgr *mgr, vsprintf(target, format, ap2); } - fields[index] = target; - mgr->used += needed; - mgr->space -= needed; + if (fields[index] != target) { + fields[index] = target; + mgr->used += needed; + mgr->space -= needed; + } } void __ast_string_field_index_build(struct ast_string_field_mgr *mgr,