On Wed, Jul 01, 2015 at 12:41:23 -0400, John Ferlan wrote:
Avoid a false positive since Coverity find a path in virResizeN
which
could return 0 prior to the allocation of memory and thus flags a
possible NULL dereference. Instead allocate the output buffer based
on 'nparams' and only fill it partially if need be - shouldn't be too
much a waste of space. Quicker than multiple VIR_RESIZE_N calls or
two loops of STREQ's sandwiched around a single VIR_ALLOC_N using
'n' matches from a first loop to generate the 'n' addresses to return
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Difference to v1: Use single VIR_ALLOC_N of nparams and one loop as
suggested in review
src/util/virtypedparam.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
ACK,
Peter