Skip to content

Commit

Permalink
beegetopt: free memory before exiting
Browse files Browse the repository at this point in the history
beegetopt is leaking memory if BEE_GETOPT_ERROR occurs

the variables beeopts and beeoptptr are now freed before exiting
  • Loading branch information
Matthias Ruester committed Feb 24, 2013
1 parent 78a39da commit d6b32f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/beegetopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ int main(int argc, char *argv[])

while((opt=bee_getopt(&optctl, &i)) != BEE_GETOPT_END) {
if (opt == BEE_GETOPT_ERROR) {
free(beeopts);
free(beeoptptr);
exit(1);
}

Expand Down

0 comments on commit d6b32f9

Please sign in to comment.