mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-23 13:58:24 +00:00
Address cppcheck 2.5 warnings (#1720)
This slightly simplifies memory management.
This commit is contained in:
parent
945cc2ac54
commit
7890989cbb
@ -2284,7 +2284,7 @@ int S3fsCurl::RequestPerform(bool dontAddAuthHeaders /*=false*/)
|
||||
}
|
||||
|
||||
LastResponseCode = S3FSCURL_RESPONSECODE_NOTSET;
|
||||
long responseCode;
|
||||
long responseCode = S3FSCURL_RESPONSECODE_NOTSET;
|
||||
int result = S3FSCURL_PERFORM_RESULT_NOTSET;
|
||||
|
||||
// 1 attempt + retries...
|
||||
|
@ -34,23 +34,20 @@ MVNODE *create_mvnode(const char *old_path, const char *new_path, bool is_dir, b
|
||||
char *p_old_path;
|
||||
char *p_new_path;
|
||||
|
||||
p = new MVNODE();
|
||||
|
||||
if(NULL == (p_old_path = strdup(old_path))){
|
||||
delete p;
|
||||
printf("create_mvnode: could not allocation memory for p_old_path\n");
|
||||
S3FS_FUSE_EXIT();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(NULL == (p_new_path = strdup(new_path))){
|
||||
delete p;
|
||||
free(p_old_path);
|
||||
printf("create_mvnode: could not allocation memory for p_new_path\n");
|
||||
S3FS_FUSE_EXIT();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = new MVNODE();
|
||||
p->old_path = p_old_path;
|
||||
p->new_path = p_new_path;
|
||||
p->is_dir = is_dir;
|
||||
|
Loading…
x
Reference in New Issue
Block a user