diff options
author | Werner Koch <[email protected]> | 2024-04-26 13:28:01 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2024-04-26 13:28:01 +0000 |
commit | a5f0e0b2f7897fc6ef1ab847146e16ef64d1d4a7 (patch) | |
tree | 608de2e874747f5efaa780e68c1e784483fbe0f3 | |
parent | Post release updates (diff) | |
download | libgpg-error-a5f0e0b2f7897fc6ef1ab847146e16ef64d1d4a7.tar.gz libgpg-error-a5f0e0b2f7897fc6ef1ab847146e16ef64d1d4a7.zip |
argparse: Fix a theoretical memory leak.
* src/argparse.c (store_alias): Free NAME because it has ownerhip
here. Take care P is actually a pointer into NAME.
--
Note that aliases have never been implemented.
GnuPG-bug-id: 7105
-rw-r--r-- | src/argparse.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/argparse.c b/src/argparse.c index 106e818..c59e5b2 100644 --- a/src/argparse.c +++ b/src/argparse.c @@ -578,12 +578,12 @@ initialize (gpgrt_argparse_t *arg, gpgrt_opt_t *opts, estream_t fp) static void store_alias( gpgrt_argparse_t *arg, char *name, char *value ) { - /* TODO: replace this dummy function with a rea one - * and fix the probelms IRIX has with (ALIAS_DEV)arg.. + /* TODO: replace this dummy function with a real one + * and fix the problems IRIX has with (ALIAS_DEV)arg.. * used as lvalue */ (void)arg; - (void)name; + xfree (name); (void)value; #if 0 ALIAS_DEF a = xmalloc( sizeof *a ); @@ -1843,6 +1843,7 @@ _gpgrt_argparse (estream_t fp, gpgrt_argparse_t *arg, gpgrt_opt_t *opts_orig) *p++ = 0; trim_spaces (p); } + if (!p || !*p) { xfree (buffer); |