diff options
author | Neil Brown <neilb@suse.de> | 2006-06-23 14:38:33 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-06-23 14:38:33 +1000 |
commit | 2e075a16da4963f54cd556403ca9e15a68de27fd (patch) | |
tree | 5e412d94ec623315a93286af4da52a2883dcd0a4 /tools | |
parent | ff42180930a444cea7f19e55e2cd2bfe6d3f108b (diff) | |
download | nfs-utils-2e075a16da4963f54cd556403ca9e15a68de27fd.tar.gz nfs-utils-2e075a16da4963f54cd556403ca9e15a68de27fd.tar.xz nfs-utils-2e075a16da4963f54cd556403ca9e15a68de27fd.zip |
Fix various issues discovered by Coverity
Thanks to Michael Halcrow for finding them.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/rpcgen/rpc_parse.c | 11 | ||||
-rw-r--r-- | tools/rpcgen/rpc_scan.c | 1 |
2 files changed, 2 insertions, 10 deletions
diff --git a/tools/rpcgen/rpc_parse.c b/tools/rpcgen/rpc_parse.c index 577312e..70d1260 100644 --- a/tools/rpcgen/rpc_parse.c +++ b/tools/rpcgen/rpc_parse.c @@ -94,6 +94,7 @@ get_definition(void) def_const(defp); break; case TOK_EOF: + free(defp); return (NULL); default: error("definition keyword expected"); @@ -290,7 +291,6 @@ def_union(definition *defp) declaration dec; case_list *cases; case_list **tailp; - int flag; defp->def_kind = DEF_UNION; scan(TOK_IDENT, &tok); @@ -309,7 +309,6 @@ def_union(definition *defp) cases->case_name = tok.str; scan(TOK_COLON, &tok); /* now peek at next token */ - flag=0; if(peekscan(TOK_CASE,&tok)) { @@ -325,14 +324,6 @@ def_union(definition *defp) }while(peekscan(TOK_CASE,&tok)); } - else - if(flag) - { - - *tailp = cases; - tailp = &cases->next; - cases = ALLOC(case_list); - }; get_declaration(&dec, DEF_UNION); cases->case_decl = dec; diff --git a/tools/rpcgen/rpc_scan.c b/tools/rpcgen/rpc_scan.c index 62d906d..51eecfe 100644 --- a/tools/rpcgen/rpc_scan.c +++ b/tools/rpcgen/rpc_scan.c @@ -468,6 +468,7 @@ docppline(char *line, int *lineno, char **fname) *p = 0; if (*file == 0) { *fname = NULL; + free(file); } else { *fname = file; } |