diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2001-01-08 23:09:30 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2001-01-08 23:09:30 +0000 |
commit | cfdb67df5d5daa13ce785a2f4e87d8f12b673d71 (patch) | |
tree | 2d3d9b569a3392e85663155bd6dfcdc81a9e07e9 /gnupgparse.c | |
parent | d5a336245304225932d3b5d18f82336bebb01efe (diff) |
Let check_sec.sh check for use of the unsafe malloc, realloc, free,
and strdup routines. While we are on it, plug some memory leaks and
make some code understandable.
Diffstat (limited to 'gnupgparse.c')
-rw-r--r-- | gnupgparse.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gnupgparse.c b/gnupgparse.c index 7be19517..c7feca89 100644 --- a/gnupgparse.c +++ b/gnupgparse.c @@ -108,7 +108,7 @@ static void fix_uid (char *uid) else if (ob-buf == n && (buf[n] = 0, strlen (buf) < n)) memcpy (uid, buf, n); } - free (buf); + safe_free ((void **) &buf); iconv_close (cd); } } @@ -291,9 +291,8 @@ pgp_key_t *pgp_get_candidates (pgp_ring_t keyring, LIST * hints) if ((devnull = open ("/dev/null", O_RDWR)) == -1) return NULL; - free (_chs); - _chs = safe_strdup (Charset); - + mutt_str_replace (&_chs, Charset); + thepid = pgp_invoke_list_keys (NULL, &fp, NULL, -1, -1, devnull, keyring, hints); if (thepid == -1) |