mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Remove redundant null pointer checks before free()
Per applicable standards, free() with a null pointer is a no-op. Systems that don't observe that are ancient and no longer relevant. Some PostgreSQL code already required this behavior, so this change does not introduce any new requirements, just makes the code more consistent. Discussion: https://www.postgresql.org/message-id/flat/dac5d2d0-98f5-94d9-8e69-46da2413593d%40enterprisedb.com
This commit is contained in:
@ -930,10 +930,8 @@ pg_ctype_get_cache(pg_wc_probefunc probefunc, int cclasscode)
|
||||
* Failure, clean up
|
||||
*/
|
||||
out_of_memory:
|
||||
if (pcc->cv.chrs)
|
||||
free(pcc->cv.chrs);
|
||||
if (pcc->cv.ranges)
|
||||
free(pcc->cv.ranges);
|
||||
free(pcc->cv.chrs);
|
||||
free(pcc->cv.ranges);
|
||||
free(pcc);
|
||||
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user