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:
Levi Neely 2026-03-07 18:56:43 +01:00
parent 0430d0b872
commit 11cecaa7de
1 changed files with 6 additions and 0 deletions

View File

@ -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),