]> granicus.if.org Git - graphviz/commit
fix rersource leakage in sccmap
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 13 Sep 2020 03:23:07 +0000 (20:23 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Sep 2020 16:42:59 +0000 (09:42 -0700)
commite4e345bf19016252bfd6a3f8f06c0ff9acf0ae46
tree3c5ff84094b0d82e745f49b430f9318759c920b2
parentb966ac6db39463e406a32bf6e3cc9c4facccc401
fix rersource leakage in sccmap

This addresses the following Coverity warning:

Error: RESOURCE_LEAK (CWE-772): [#def69]
graphviz-2.40.1/cmd/tools/sccmap.c:356: alloc_fn: Storage is returned from allocation function "openFile".
graphviz-2.40.1/cmd/tools/sccmap.c:313:5: alloc_fn: Storage is returned from allocation function "fopen".
graphviz-2.40.1/cmd/tools/sccmap.c:313:5: var_assign: Assigning: "fp" = "fopen(name, mode)".
graphviz-2.40.1/cmd/tools/sccmap.c:323:5: return_alloc: Returning allocated memory "fp".
graphviz-2.40.1/cmd/tools/sccmap.c:356: var_assign: Assigning: "outfp" = storage returned from "openFile(optarg, "w")".
graphviz-2.40.1/cmd/tools/sccmap.c:356: overwrite_var: Overwriting "outfp" in "outfp = openFile(optarg, "w")" leaks the storage that "outfp" points to.

Related to #1464.
cmd/tools/sccmap.c