Protect against XLogReaderAllocate() failing to allocate memory.

Andres Freund <andres@anarazel.de>

Commit: ed5b0f79512aa37fc92d2097bc9a0b93a27eaee2
Author: Andres Freund <andres@anarazel.de>
Date: 2015-01-08T12:35:04Z
Releases: 9.4.1
Protect against XLogReaderAllocate() failing to allocate memory.

logical.c's StartupDecodingContext() forgot to check whether
XLogReaderAllocate() returns NULL indicating a memory allocation
failure.  This could lead, although quite unlikely, lead to a NULL
pointer dereference.

This only applies to 9.4 as earlier versions don't do logical
decoding, and later versions don't return NULL after allocation
failures in XLogReaderAllocate().

Michael Paquier, with minor changes by me.

Files

PathChange+/−
src/backend/replication/logical/logical.c modified +5 −0