From 2e075a16da4963f54cd556403ca9e15a68de27fd Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Fri, 23 Jun 2006 14:38:33 +1000 Subject: Fix various issues discovered by Coverity Thanks to Michael Halcrow for finding them. --- tools/rpcgen/rpc_parse.c | 11 +---------- tools/rpcgen/rpc_scan.c | 1 + 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'tools') 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; } -- cgit