Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0dcc73f

Browse files
committed
Ensure xmlFree(NULL) is a no-op instead of a core dump. Per report from
Sergey Burladyan, there are at least some dank corners of libxml2 thatassume this behavior, even though their published documentation suggeststhey shouldn't.This is only really a live problem in 8.3, but the code is still therefor possible debugging use in HEAD, so patch both branches.
1 parentf371fda commit0dcc73f

File tree

1 file changed

+4
-2
lines changed
  • src/backend/utils/adt

1 file changed

+4
-2
lines changed

‎src/backend/utils/adt/xml.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.90 2009/06/09 22:00:57 petere Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.91 2009/06/10 03:44:35 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1293,7 +1293,9 @@ xml_repalloc(void *ptr, size_t size)
12931293
staticvoid
12941294
xml_pfree(void*ptr)
12951295
{
1296-
pfree(ptr);
1296+
/* At least some parts of libxml assume xmlFree(NULL) is allowed */
1297+
if (ptr)
1298+
pfree(ptr);
12971299
}
12981300

12991301

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp