]> git.sesse.net Git - nageru/commitdiff
Fix a leak in test code.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 21 Dec 2018 22:42:34 +0000 (23:42 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 21 Dec 2018 22:42:34 +0000 (23:42 +0100)
Found by Coverity Scan.

futatabi/util.cpp

index 061408d7a69781c88adfde4b4fc65e662e686464..99711a6f55875c0d0156879fec32e16c24b3a18c 100644 (file)
@@ -16,6 +16,7 @@ Flow read_flow(const char *filename)
 
        unique_ptr<Vec2[]> flow(new Vec2[width * height]);
        fread(flow.get(), width * height * sizeof(Vec2), 1, flowfp);
+       fclose(flowfp);
 
        Flow ret;
        ret.width = width;