Skip to content

Commit

Permalink
pppd/options.c: fix memory leak on error path (#441)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chipitsine authored Sep 1, 2023
1 parent 59342ab commit 26d1b60
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pppd/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 26d1b60

Please sign in to comment.