If make_tempfile() returns -1 in set_backlog_size, exit properly.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:13:45 +0000 (19:13 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:13:45 +0000 (19:13 +0200)
Found by Coverity Scan.

stream.cpp

index 3e0d78d..83257e9 100644 (file)
@@ -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.