From 479933dbc99e984f1ecf9987441fa3ee8a7bd382 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 19 Apr 2013 19:13:45 +0200 Subject: [PATCH] If make_tempfile() returns -1 in set_backlog_size, exit properly. Found by Coverity Scan. --- stream.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stream.cpp b/stream.cpp index 3e0d78d..83257e9 100644 --- a/stream.cpp +++ b/stream.cpp @@ -110,6 +110,9 @@ void Stream::set_backlog_size(size_t new_size) // Create a new, empty data file. data_fd = make_tempfile(""); + if (data_fd == -1) { + exit(1); + } backlog_size = new_size; // Now cheat a bit by rewinding, and adding all the old data back. -- 2.39.2