Fix memory leaks in pfs_reopen_file_for_writing and clean_uploads_for_task
pfs.c: encsymkey from pcryptofolder_filencoder_key_get was freed on all error paths in pfs_reopen_file_for_writing but not on the success path that returns 1 after ppagecache_copy_to_file_locked. pfsupload.c: fr from psql_fetchall_int was never freed in clean_uploads_for_task; add pmem_free after the upload loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
886abae1ab
commit
723a39540b
|
|
@ -2240,6 +2240,7 @@ pfs_reopen_file_for_writing(psync_openfile_t *of) {
|
|||
}
|
||||
}
|
||||
of->currentsize = of->initialsize;
|
||||
pmem_free(PMEM_SUBSYS_OTHER, encsymkey);
|
||||
return 1;
|
||||
}
|
||||
cr = pfs_task_add_modified_file(of->currentfolder, of->currentname,
|
||||
|
|
|
|||
|
|
@ -318,6 +318,7 @@ static int clean_uploads_for_task(psock_t *api, psync_uploadid_t taskid) {
|
|||
} else
|
||||
pmem_free(PMEM_SUBSYS_UPLOAD, res);
|
||||
}
|
||||
pmem_free(PMEM_SUBSYS_UPLOAD, fr);
|
||||
sql = psql_prepare("DELETE FROM fstaskupload WHERE fstaskid=?");
|
||||
psql_bind_uint(sql, 1, taskid);
|
||||
psql_run_free(sql);
|
||||
|
|
|
|||
Loading…
Reference in New Issue