Skip to content

Commit

Permalink
Fix free pdu mismatch with alloc
Browse files Browse the repository at this point in the history
The pdu alloced by iscsi->drv->new_pdu, by free with iscsi_free direct
when fail in iscsi_allocate_pdu.

Signed-off-by: IriKa Qiu <[email protected]>
  • Loading branch information
ir1ka committed Nov 10, 2024
1 parent 2934d64 commit 057fa61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ iscsi_allocate_pdu(struct iscsi_context *iscsi, enum iscsi_opcode opcode,

if (pdu->outdata.data == NULL) {
iscsi_set_error(iscsi, "failed to allocate pdu header");
iscsi_free(iscsi, pdu);
iscsi->drv->free_pdu(iscsi, pdu);
return NULL;
}

Expand Down

0 comments on commit 057fa61

Please sign in to comment.