mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 19:08:14 +00:00
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
This commit is contained in:
@@ -1298,9 +1298,11 @@ void __ast_string_field_index_build_va(struct ast_string_field_mgr *mgr,
|
|||||||
vsprintf(target, format, ap2);
|
vsprintf(target, format, ap2);
|
||||||
}
|
}
|
||||||
|
|
||||||
fields[index] = target;
|
if (fields[index] != target) {
|
||||||
mgr->used += needed;
|
fields[index] = target;
|
||||||
mgr->space -= needed;
|
mgr->used += needed;
|
||||||
|
mgr->space -= needed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void __ast_string_field_index_build(struct ast_string_field_mgr *mgr,
|
void __ast_string_field_index_build(struct ast_string_field_mgr *mgr,
|
||||||
|
|||||||
Reference in New Issue
Block a user