|
@@ -266,7 +266,8 @@ static int slam_tx_nack ( struct slam_request *slam ) {
|
266
|
266
|
if ( ! iobuf ) {
|
267
|
267
|
DBGC ( slam, "SLAM %p could not allocate I/O buffer\n",
|
268
|
268
|
slam );
|
269
|
|
- return -ENOMEM;
|
|
269
|
+ rc = -ENOMEM;
|
|
270
|
+ goto err_alloc;
|
270
|
271
|
}
|
271
|
272
|
|
272
|
273
|
/* Construct NACK. We always request only a single packet;
|
|
@@ -294,14 +295,19 @@ static int slam_tx_nack ( struct slam_request *slam ) {
|
294
|
295
|
"0-%ld\n", slam, ( num_blocks - 1 ) );
|
295
|
296
|
}
|
296
|
297
|
if ( ( rc = slam_put_value ( slam, iobuf, first_block ) ) != 0 )
|
297
|
|
- return rc;
|
|
298
|
+ goto err_put_value;
|
298
|
299
|
if ( ( rc = slam_put_value ( slam, iobuf, num_blocks ) ) != 0 )
|
299
|
|
- return rc;
|
|
300
|
+ goto err_put_value;
|
300
|
301
|
nul = iob_put ( iobuf, 1 );
|
301
|
302
|
*nul = 0;
|
302
|
303
|
|
303
|
304
|
/* Transmit packet */
|
304
|
|
- return xfer_deliver_iob ( &slam->socket, iobuf );
|
|
305
|
+ return xfer_deliver_iob ( &slam->socket, iob_disown ( iobuf ) );
|
|
306
|
+
|
|
307
|
+ err_put_value:
|
|
308
|
+ free_iob ( iobuf );
|
|
309
|
+ err_alloc:
|
|
310
|
+ return rc;
|
305
|
311
|
}
|
306
|
312
|
|
307
|
313
|
/**
|