This addresses the following Coverity warning:
Error: RESOURCE_LEAK (CWE-772): [#def60]
graphviz-2.40.1/cmd/tools/gvpack.c:239: alloc_fn: Storage is returned from allocation function "openFile".
graphviz-2.40.1/cmd/tools/gvpack.c:124:5: alloc_fn: Storage is returned from allocation function "fopen".
graphviz-2.40.1/cmd/tools/gvpack.c:124:5: var_assign: Assigning: "fp" = "fopen(name, mode)".
graphviz-2.40.1/cmd/tools/gvpack.c:134:5: return_alloc: Returning allocated memory "fp".
graphviz-2.40.1/cmd/tools/gvpack.c:239: var_assign: Assigning: "outfp" = storage returned from "openFile(optarg, "w")".
graphviz-2.40.1/cmd/tools/gvpack.c:239: overwrite_var: Overwriting "outfp" in "outfp = openFile(optarg, "w")" leaks the storage that "outfp" points to.
# 237| break;
# 238| case 'o':
# 239|-> outfp = openFile(optarg, "w");
# 240| break;
# 241| case 'u':
Related to #1464.
setUInt(&pinfo->margin, optarg);
break;
case 'o':
+ if (outfp != NULL)
+ fclose(outfp);
outfp = openFile(optarg, "w");
break;
case 'u':