mirror of https://github.com/citusdata/citus.git
Fix pg_worker_list use-after-free bug
This change fixes a use-after-free bug while renaming obsolete `pg_worker_list.conf` file, which causes Citus to crash during upgrade (or even extension creation) if `pg_worker_list.conf` exists.release-6.2
parent
124b0f9020
commit
44eacf14fc
|
@ -1065,14 +1065,14 @@ ParseWorkerNodeFileAndRename()
|
||||||
workerNodeList = lappend(workerNodeList, workerNode);
|
workerNodeList = lappend(workerNodeList, workerNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
FreeFile(workerFileStream);
|
|
||||||
free(workerFilePath);
|
|
||||||
|
|
||||||
/* rename the file, marking that it is not used anymore */
|
/* rename the file, marking that it is not used anymore */
|
||||||
appendStringInfo(renamedWorkerFilePath, "%s", workerFilePath);
|
appendStringInfo(renamedWorkerFilePath, "%s", workerFilePath);
|
||||||
appendStringInfo(renamedWorkerFilePath, ".obsolete");
|
appendStringInfo(renamedWorkerFilePath, ".obsolete");
|
||||||
rename(workerFilePath, renamedWorkerFilePath->data);
|
rename(workerFilePath, renamedWorkerFilePath->data);
|
||||||
|
|
||||||
|
FreeFile(workerFileStream);
|
||||||
|
free(workerFilePath);
|
||||||
|
|
||||||
return workerNodeList;
|
return workerNodeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue