From 54cfa1ace0145b82c40ef72cb58525eb611a4743 Mon Sep 17 00:00:00 2001 From: minoplhy Date: Wed, 10 Apr 2024 01:10:38 +0700 Subject: [PATCH] chibisafe_netstorage_middleman : defer reset --- src/handler/chibisafe.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/handler/chibisafe.go b/src/handler/chibisafe.go index 3b4014b..1c039a4 100644 --- a/src/handler/chibisafe.go +++ b/src/handler/chibisafe.go @@ -107,6 +107,9 @@ func NetworkStoragePut(URL string, ContentType string, filepath string) ([]byte, // Set appropriate headers for the file req.Header.Set("Content-Type", ContentType) + // clear memory for others process to use + defer buffer.Reset() + // Send the request resp, err := client.Do(req) if err != nil {