From d6b32f994bac4c0210e284f60822b11bd84ca8cc Mon Sep 17 00:00:00 2001 From: Matthias Ruester Date: Sat, 29 Dec 2012 22:34:58 +0100 Subject: [PATCH] beegetopt: free memory before exiting beegetopt is leaking memory if BEE_GETOPT_ERROR occurs the variables beeopts and beeoptptr are now freed before exiting --- src/beegetopt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/beegetopt.c b/src/beegetopt.c index a66f5d3..ffbbd85 100644 --- a/src/beegetopt.c +++ b/src/beegetopt.c @@ -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); }