]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
consistently assert correct FD state before opening/closing
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 9 Oct 2010 12:28:51 +0000 (01:28 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 9 Oct 2010 12:28:51 +0000 (01:28 +1300)
src/fd.cc

index e895d9c1f4b8820d4d7c41d2e6dbc8c404be8aa8..74ca6c958e5117560708ba10c18e220742ad4cde 100644 (file)
--- a/src/fd.cc
+++ b/src/fd.cc
@@ -104,6 +104,9 @@ fd_close(int fd)
 {
     fde *F = &fd_table[fd];
 
+    assert(fd >= 0);
+    assert(F->flags.open == 1);
+
     if (F->type == FD_FILE) {
         assert(F->read_handler == NULL);
         assert(F->write_handler == NULL);