From e893031d91ae4046069b76b7f8a03f9e99a4ad89 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 28 Dec 2017 05:33:29 +0000 Subject: [PATCH] Plug two resource leaks. CID: 92077, 92074 --- usr.bin/rpcgen/rpc_parse.c | 1 + usr.bin/rpcgen/rpc_scan.c | 1 + 2 files changed, 2 insertions(+) diff --git a/usr.bin/rpcgen/rpc_parse.c b/usr.bin/rpcgen/rpc_parse.c index 9f8803337896..0081106f8512 100644 --- a/usr.bin/rpcgen/rpc_parse.c +++ b/usr.bin/rpcgen/rpc_parse.c @@ -93,6 +93,7 @@ get_definition(void) def_const(defp); break; case TOK_EOF: + free(defp); return (NULL); default: error("definition keyword expected"); diff --git a/usr.bin/rpcgen/rpc_scan.c b/usr.bin/rpcgen/rpc_scan.c index bdbeec0f2d07..49466bd18849 100644 --- a/usr.bin/rpcgen/rpc_scan.c +++ b/usr.bin/rpcgen/rpc_scan.c @@ -490,6 +490,7 @@ docppline(char *line, int *lineno, const char **fname) *p = 0; if (*file == 0) { *fname = NULL; + free(file); } else { *fname = file; }