Commit 8607639
committed
Fix coding rules violations in walreceiver.c
1. Since commit b1a9bad we had pstrdup() inside a
spinlock-protected critical section; reported by Andreas Seltenreich.
Turn those into strlcpy() to stack-allocated variables instead.
Backpatch to 9.6.
2. Since commit 9ed551e we had a pfree() uselessly inside a
spinlock-protected critical section. Tom Lane noticed in code review.
Move down. Backpatch to 9.6.
3. Since commit 6423390 we had GetCurrentTimestamp() (a kernel
call) inside a spinlock-protected critical section. Tom Lane noticed in
code review. Move it up. Backpatch to 9.2.
4. Since commit 1bb2558 we did elog(PANIC) while holding spinlock.
Tom Lane noticed in code review. Release spinlock before dying.
Backpatch to 9.2.
Discussion: https://postgr.es/m/87h8vhtgj2.fsf@ansel.ydns.eu1 parent 858e9f2 commit 8607639
1 file changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| |||
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| 213 | + | |
| 214 | + | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| |||
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
256 | | - | |
| 260 | + | |
| 261 | + | |
257 | 262 | | |
258 | 263 | | |
259 | 264 | | |
| |||
317 | 322 | | |
318 | 323 | | |
319 | 324 | | |
320 | | - | |
321 | 325 | | |
322 | | - | |
323 | | - | |
324 | 326 | | |
325 | 327 | | |
326 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
327 | 332 | | |
328 | 333 | | |
329 | 334 | | |
| |||
1349 | 1354 | | |
1350 | 1355 | | |
1351 | 1356 | | |
1352 | | - | |
1353 | | - | |
| 1357 | + | |
| 1358 | + | |
1354 | 1359 | | |
1355 | 1360 | | |
1356 | 1361 | | |
| |||
1377 | 1382 | | |
1378 | 1383 | | |
1379 | 1384 | | |
1380 | | - | |
1381 | | - | |
| 1385 | + | |
| 1386 | + | |
1382 | 1387 | | |
1383 | 1388 | | |
1384 | 1389 | | |
| |||
0 commit comments