Browse Source

[nfs] Fix double free bug on error path

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 years ago
parent
commit
e500e5dd07
1 changed files with 1 additions and 6 deletions
  1. 1
    6
      src/net/tcp/oncrpc.c

+ 1
- 6
src/net/tcp/oncrpc.c View File

@@ -128,7 +128,6 @@ void oncrpc_init_session ( struct oncrpc_session *session,
128 128
 
129 129
 int oncrpc_call ( struct interface *intf, struct oncrpc_session *session,
130 130
                   uint32_t proc_name, const struct oncrpc_field fields[] ) {
131
-	int              rc;
132 131
 	size_t           frame_size;
133 132
 	struct io_buffer *io_buf;
134 133
 
@@ -161,11 +160,7 @@ int oncrpc_call ( struct interface *intf, struct oncrpc_session *session,
161 160
 	oncrpc_iob_add_fields ( io_buf, header );
162 161
 	oncrpc_iob_add_fields ( io_buf, fields );
163 162
 
164
-	rc = xfer_deliver_iob ( intf, io_buf );
165
-	if ( rc != 0 )
166
-		free_iob ( io_buf );
167
-
168
-	return rc;
163
+	return xfer_deliver_iob ( intf, iob_disown ( io_buf ) );
169 164
 }
170 165
 
171 166
 size_t oncrpc_compute_size ( const struct oncrpc_field fields[] ) {

Loading…
Cancel
Save