]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[nfs] Fix double free bug on error path
authorMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 11:45:17 +0000 (13:45 +0200)
committerMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 11:46:26 +0000 (13:46 +0200)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tcp/oncrpc.c

index 6469867e910f0f4a5ed7b7f552f4e0590401c89b..cb66aeb85163f4afa33ed2b83a50b990b236d8ee 100644 (file)
@@ -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;
 
@@ -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[] ) {