diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-08-09 09:54:19 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2021-08-09 09:54:19 +0300 |
commit | 32f1c74166b04b4cb4d2bd057c23a575d4b2d24e (patch) | |
tree | ff3dd25444dc137624378ea5527face2a633d2a4 | |
parent | 61970346dcfe83b0b9885117af1815b9d2b8ab20 (diff) | |
download | gdbm-32f1c74166b04b4cb4d2bd057c23a575d4b2d24e.tar.gz |
Make parseopt reentrant.
* src/parseopt.c (parseopt_first): Initialize option tables to NULL.
-rw-r--r-- | src/parseopt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parseopt.c b/src/parseopt.c index d291632..bc47597 100644 --- a/src/parseopt.c +++ b/src/parseopt.c @@ -193,10 +193,13 @@ int parseopt_first (int pc, char **pv, struct gdbm_option *opts) { free (option_tab); + option_tab = NULL; free (short_options); + short_options = NULL; short_option_count = short_option_max = 0; #ifdef HAVE_GETOPT_LONG free (long_options); + long_options = NULL; long_option_count = long_option_max = 0; #endif add_options (opts); |