This addresses the following Coverity warning:
Error: RESOURCE_LEAK (CWE-772): [#def57]
graphviz-2.40.1/cmd/tools/gv2gml.c:713: alloc_fn: Storage is returned from allocation function "openFile".
graphviz-2.40.1/cmd/tools/gv2gml.c:666:5: alloc_fn: Storage is returned from allocation function "fopen".
graphviz-2.40.1/cmd/tools/gv2gml.c:666:5: var_assign: Assigning: "fp" = "fopen(name, mode)".
graphviz-2.40.1/cmd/tools/gv2gml.c:677:5: return_alloc: Returning allocated memory "fp".
graphviz-2.40.1/cmd/tools/gv2gml.c:713: var_assign: Assigning: "outFile" = storage returned from "openFile(optarg, "w")".
graphviz-2.40.1/cmd/tools/gv2gml.c:713: overwrite_var: Overwriting "outFile" in "outFile = openFile(optarg, "w")" leaks the storage that "outFile" points to.
# 711| switch (c) {
# 712| case 'o':
# 713|-> outFile = openFile(optarg, "w");
# 714| break;
# 715| case ':':
Related to #1464.
while ((c = getopt(argc, argv, ":o:")) != -1) {
switch (c) {
case 'o':
+ if (outFile != NULL)
+ fclose(outFile);
outFile = openFile(optarg, "w");
break;
case ':':