Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[nfs] Fix double free bug on error path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 21, 2017
1 parent 91372d6 commit e500e5d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/net/tcp/oncrpc.c
Expand Up @@ -128,7 +128,6 @@ void oncrpc_init_session ( struct oncrpc_session *session,

int oncrpc_call ( struct interface *intf, struct oncrpc_session *session,
uint32_t proc_name, const struct oncrpc_field fields[] ) {
int rc;
size_t frame_size;
struct io_buffer *io_buf;

Expand Down Expand Up @@ -161,11 +160,7 @@ int oncrpc_call ( struct interface *intf, struct oncrpc_session *session,
oncrpc_iob_add_fields ( io_buf, header );
oncrpc_iob_add_fields ( io_buf, fields );

rc = xfer_deliver_iob ( intf, io_buf );
if ( rc != 0 )
free_iob ( io_buf );

return rc;
return xfer_deliver_iob ( intf, iob_disown ( io_buf ) );
}

size_t oncrpc_compute_size ( const struct oncrpc_field fields[] ) {
Expand Down

0 comments on commit e500e5d

Please sign in to comment.