File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
sdk/storage/Azure.Storage.Common/src/Shared Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,8 @@ public async Task<Response<TCompleteUploadReturn>> UploadInternal(
380380 // If we know the length and it's small enough
381381 if ( length < _singleUploadThreshold )
382382 {
383+ IDisposable disposable = null ;
384+
383385 // may not be seekable. buffer if that's the case
384386 if ( ! content . CanSeek )
385387 {
@@ -394,10 +396,11 @@ public async Task<Response<TCompleteUploadReturn>> UploadInternal(
394396 maxArrayPoolRentalSize : default ,
395397 async,
396398 cancellationToken ) . ConfigureAwait ( false ) ;
399+ disposable = content ;
397400 }
398401
399402 // Upload it in a single request
400- return await _singleUploadStreamingInternal (
403+ var result = await _singleUploadStreamingInternal (
401404 content ,
402405 args ,
403406 progressHandler ,
@@ -406,6 +409,9 @@ public async Task<Response<TCompleteUploadReturn>> UploadInternal(
406409 async ,
407410 cancellationToken )
408411 . ConfigureAwait( false) ;
412+
413+ disposable? . Dispose( ) ;
414+ return result;
409415 }
410416
411417 // If the caller provided an explicit block size, we'll use it.
You can’t perform that action at this time.
0 commit comments