Free some variables before they go out of scope.

CID: 92074, 270099
This commit is contained in:
imp 2017-12-28 05:33:34 +00:00
parent c447f95dc1
commit 5f0ec9196a

View File

@ -484,7 +484,9 @@ generate_guard(const char *pathname)
;
strcpy(guard, tmp);
}
tmp = guard;
guard = extendfile(guard, "_H_RPCGEN");
free(tmp);
return (guard);
}
@ -502,13 +504,14 @@ h_output(const char *infile, const char *define, int extend, const char *outfile
const char *guard;
list *l;
xdrfunc *xdrfuncp;
void *tmp = NULL;
open_input(infile, define);
outfilename = extend ? extendfile(infile, outfile) : outfile;
open_output(infile, outfilename);
add_warning();
if (outfilename || infile){
guard = generate_guard(outfilename ? outfilename: infile);
guard = tmp = generate_guard(outfilename ? outfilename: infile);
} else
guard = "STDIN_";
@ -574,6 +577,7 @@ h_output(const char *infile, const char *define, int extend, const char *outfile
f_print(fout, "#endif\n");
f_print(fout, "\n#endif /* !_%s */\n", guard);
free(tmp);
}
/*