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.pull/1551/head
parent
b7e55e0c81
commit
b3d2f9ba71
|
@ -1367,14 +1367,14 @@ ParseWorkerNodeFileAndRename()
|
|||
workerNodeList = lappend(workerNodeList, workerNode);
|
||||
}
|
||||
|
||||
FreeFile(workerFileStream);
|
||||
free(workerFilePath);
|
||||
|
||||
/* rename the file, marking that it is not used anymore */
|
||||
appendStringInfo(renamedWorkerFilePath, "%s", workerFilePath);
|
||||
appendStringInfo(renamedWorkerFilePath, ".obsolete");
|
||||
rename(workerFilePath, renamedWorkerFilePath->data);
|
||||
|
||||
FreeFile(workerFileStream);
|
||||
free(workerFilePath);
|
||||
|
||||
return workerNodeList;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue