Several fixes for bt_iter_pos related functions
authorFrancis Deslauriers <francis.deslauriers@polymtl.ca>
Wed, 4 Jul 2012 13:15:25 +0000 (09:15 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 4 Jul 2012 13:15:25 +0000 (09:15 -0400)
commit5acdc773a649e8fe104cc0e3647b568280c58f05
tree8686b6bfbecad2296a6037b0b8029274a1dc453d
parente32cb1e4f82ebe10dd9c6d13a506608d12427639
Several fixes for bt_iter_pos related functions

Add verification so we free the array only if iterator is of type BT_SEEK_RESTORE
Add return statement at the end of case
Set type of bt_iter_pos returned by bt_iter_get_pos

[ Mathieu Desnoyers edit: check the iter_pos->type before the restore
  pointer in bt_iter_free_pos. The && operator is a sequence point, so
  the first check is done before the second. Since we might not be
  using the union for restore if type != BT_SEEK_RESTORE, check the
  type first before accessing the (possibly wrong) union field. ]

Signed-off-by: Francis Deslauriers <francis.deslauriers@polymtl.ca>
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/iterator.c
This page took 0.024097 seconds and 4 git commands to generate.