Fix pcl-dls.1: free errPtr between calls in ptools_set_backend_file_dates()
char *errPtr was already used instead of char msgErr[1024], but was not freed between the two ptools_backend_call() invocations. If the first call allocated errPtr, the second would overwrite the pointer without freeing it. Add free(errPtr); errPtr = NULL; between the two calls to eliminate the leak. Ref GH #194. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0430d0b872
commit
11cecaa7de
|
|
@ -513,6 +513,12 @@ int ptools_set_backend_file_dates(uint64_t fileid, time_t ctime, time_t mtime) {
|
|||
|
||||
pdbg_logf(D_NOTICE, "cTime res: [%d]", callRes);
|
||||
|
||||
/* Free errPtr before reuse to avoid leak if first call allocated it */
|
||||
if (errPtr) {
|
||||
free(errPtr);
|
||||
errPtr = NULL;
|
||||
}
|
||||
|
||||
eventParams requiredParams = {5,
|
||||
{PAPI_STR("auth", psync_my_auth),
|
||||
PAPI_NUM("fileid", fileid),
|
||||
|
|
|
|||
Loading…
Reference in New Issue