From 26d1b60f4984fe71005c4f1a99691e714920f33c Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Fri, 1 Sep 2023 13:57:55 +0200 Subject: [PATCH] pppd/options.c: fix memory leak on error path (#441) found by Coverity 602err: 603 fclose(f); 604 privileged_option = oldpriv; CID 436193 (#1 of 1): Resource leak (RESOURCE_LEAK)10. overwrite_var: Overwriting option_source in option_source = oldsource leaks the storage that option_source points to. 605 option_source = oldsource; Signed-off-by: Ilya Shipitsin --- pppd/options.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pppd/options.c b/pppd/options.c index 4b3e93e..227e615 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -601,6 +601,7 @@ ppp_options_from_file(char *filename, int must_exist, int check_prot, int priv) err: fclose(f); + free(option_source); privileged_option = oldpriv; option_source = oldsource; return ret; -- 2.39.2