mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-02-03 11:08:26 +00:00
Plug memory leak
Previously this appended to an empty list, zeroed the list, then appended to the list. Instead zero the list first and then append. This also enables sending Content-MD5 which can eagerly detect transmission errors. Found via Valgrind.
This commit is contained in:
parent
25b49e1a2e
commit
58ce544e83
@ -3452,6 +3452,8 @@ int S3fsCurl::UploadMultipartPostSetup(const char* tpath, int part_num, const st
|
||||
return -1;
|
||||
}
|
||||
|
||||
requestHeaders = NULL;
|
||||
|
||||
// make md5 and file pointer
|
||||
if(S3fsCurl::is_content_md5){
|
||||
unsigned char *md5raw = s3fs_md5hexsum(partdata.fd, partdata.startpos, partdata.size);
|
||||
@ -3481,7 +3483,6 @@ int S3fsCurl::UploadMultipartPostSetup(const char* tpath, int part_num, const st
|
||||
turl += urlargs;
|
||||
url = prepare_url(turl.c_str());
|
||||
path = get_realpath(tpath);
|
||||
requestHeaders = NULL;
|
||||
bodydata = new BodyData();
|
||||
headdata = new BodyData();
|
||||
responseHeaders.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user