summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorMichael Brown2017-03-21 12:45:17 +0100
committerMichael Brown2017-03-21 12:46:26 +0100
commite500e5dd07c17d8c8ff5177ddb0a883d89998918 (patch)
treec1e67b276c46b1bba910d8de7d9761c442cc4327 /src/net
parent[xfer] Ensure va_end() is called on failure path (diff)
downloadipxe-e500e5dd07c17d8c8ff5177ddb0a883d89998918.tar.gz
ipxe-e500e5dd07c17d8c8ff5177ddb0a883d89998918.tar.xz
ipxe-e500e5dd07c17d8c8ff5177ddb0a883d89998918.zip
[nfs] Fix double free bug on error path
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tcp/oncrpc.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/net/tcp/oncrpc.c b/src/net/tcp/oncrpc.c
index 6469867e..cb66aeb8 100644
--- a/src/net/tcp/oncrpc.c
+++ b/src/net/tcp/oncrpc.c
@@ -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[] ) {