[Asterisk-code-review] vector: Add AST_VECTOR_COMPACT() to reclaim wasted space (...asterisk[13])

Corey Farrell asteriskteam at digium.com
Fri Mar 15 14:40:24 CDT 2019


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/11150 )

Change subject: vector: Add AST_VECTOR_COMPACT() to reclaim wasted space
......................................................................


Patch Set 3: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/11150/3/include/asterisk/vector.h 
File include/asterisk/vector.h:

https://gerrit.asterisk.org/#/c/11150/3/include/asterisk/vector.h@605 
PS3, Line 605: 			typeof((vec)->elems) new_elems = ast_realloc(		\
We need special handling for `(vec)->current == 0`.  In that case realloc will actually free() and possibly return NULL, at which point we will fail to clear (vec)->elems and have a reference to free'd memory.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11150
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I9711daa0fe01783fc6f04c5710eba84f2676d7b9
Gerrit-Change-Number: 11150
Gerrit-PatchSet: 3
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Fri, 15 Mar 2019 19:40:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190315/23296bfa/attachment.html>


More information about the asterisk-code-review mailing list