From: Steinar H. Gunderson Date: Fri, 19 Apr 2013 17:13:45 +0000 (+0200) Subject: If make_tempfile() returns -1 in set_backlog_size, exit properly. X-Git-Tag: 1.0.0~71 X-Git-Url: https://git.sesse.net/?p=cubemap;a=commitdiff_plain;h=479933dbc99e984f1ecf9987441fa3ee8a7bd382;hp=5cd46e39b4063d94f6dc559ae350beeb8406a8f9 If make_tempfile() returns -1 in set_backlog_size, exit properly. Found by Coverity Scan. --- 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.