• Stephen Frost's avatar
    Be sure to close() file descriptor on error case · cec62efd
    Stephen Frost authored
    In receivelog.c:writeTimeLineHistoryFile(), we were not properly
    closing the open'd file descriptor in error cases.  While this
    wouldn't matter much if we were about to exit due to such an
    error, that's not the case with pg_receivexlog as it can be a
    long-running process and these errors are non-fatal.
    
    This resource leak was found by the Coverity scanner.
    
    Back-patch to 9.3 where this issue first appeared.
    cec62efd
receivelog.c 27.8 KB