]> git.ipfire.org Git - thirdparty/asterisk.git/commit
vector.h: Fix implementation of AST_VECTOR_COMPACT() for empty vectors
authorSean Bright <sean.bright@gmail.com>
Tue, 4 Aug 2020 15:51:16 +0000 (11:51 -0400)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 10 Aug 2020 12:11:38 +0000 (07:11 -0500)
commitf606312b8f06452b4928da9f574174440a5164b7
tree10edb6a2ec7d6c8e1217502957ba2a8ddc6f9b1a
parentbfee7e1550cacd827bcd3d778596fcefe8d57a36
vector.h: Fix implementation of AST_VECTOR_COMPACT() for empty vectors

The assumed behavior of realloc() - that it was effectively a free() if
its second argument was 0 - is Linux specific behavior and is not
guaranteed by either POSIX or the C specification.

Instead, if we want to resize a vector to 0, do it explicitly.

Change-Id: Ife31d4b510ebab41cb5477fdc7ea4e3138ca8b4f
include/asterisk/vector.h