diff options
author | stefanf <stefanf@FreeBSD.org> | 2005-08-07 08:35:39 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2005-08-07 08:35:39 +0000 |
commit | 7907f74429f7c0fd75c643f450bb1e813c444315 (patch) | |
tree | d825b4f4f7523e559e5839c88fab7eaae33f735e /lib/libedit/map.c | |
parent | 449d4474b42c2ce47f7067f0435eb71eda24bd52 (diff) | |
download | FreeBSD-src-7907f74429f7c0fd75c643f450bb1e813c444315.zip FreeBSD-src-7907f74429f7c0fd75c643f450bb1e813c444315.tar.gz |
Revert the replacement of realloc() with reallocf() (el.h:1.2, map.c:1.5 and
tokenizer.c:1.3). Contrary to the commit log there were no memory leaks,
but the change introduced a bug because the free'd pointer was not zeroed
and calling the appropriate _end() function would call free() a second time.
Diffstat (limited to 'lib/libedit/map.c')
-rw-r--r-- | lib/libedit/map.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libedit/map.c b/lib/libedit/map.c index 67c61cf..eae4da2 100644 --- a/lib/libedit/map.c +++ b/lib/libedit/map.c @@ -1395,10 +1395,10 @@ map_addfunc(EditLine *el, const char *name, const char *help, el_func_t func) if (name == NULL || help == NULL || func == NULL) return (-1); - if ((p = el_reallocf(el->el_map.func, nf * sizeof(el_func_t))) == NULL) + if ((p = el_realloc(el->el_map.func, nf * sizeof(el_func_t))) == NULL) return (-1); el->el_map.func = (el_func_t *) p; - if ((p = el_reallocf(el->el_map.help, nf * sizeof(el_bindings_t))) + if ((p = el_realloc(el->el_map.help, nf * sizeof(el_bindings_t))) == NULL) return (-1); el->el_map.help = (el_bindings_t *) p; |