sahlberg/libiscsi — pull request #108 by bonzini (2014-04-02 14:54:35+00:00)
Title: libiscsi: fix dangling pointer for outqueue_current

Ronnie, I'm not 100% sure this is the right fix. Perhaps @plieven can help reviewing too.

The outqueue_current PDU might also be in waitpdu if it does not have ISCSI_PDU_DELETE_WHEN_SENT. outqueue_current is freed after the waitpdu list (for reconnect or defer_reconnect), or sometimes not considered at all (for cancel), and this can cause a dangling pointer.

Keep outqueue_current up to date when a PDU is freed. A bit hacky, but it avoids touching code all over the place.