From d0bc782706b46fad9a293f25ebfbbd9b32503aac Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 7 Jul 2008 19:31:23 -0400 Subject: - when resizing a berval list, free the old list pointer before overwriting it - free the temporary copy of the expression when evaluating a simple expression - when getting a data set, free temporary data --- src/format.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/format.c b/src/format.c index e26a865..d75ae5c 100644 --- a/src/format.c +++ b/src/format.c @@ -274,6 +274,7 @@ format_add_bv_list(struct berval ***bvlist, const struct berval *bv) if (list[i]->bv_val != NULL) { list[i]->bv_len = bv->bv_len; list[i + 1] = NULL; + free(*bvlist); *bvlist = list; } else { free(list[i]); @@ -1709,11 +1710,15 @@ format_expand_simple(struct plugin_state *state, * */ format_add_choice(outbuf_choices, outbuf, values); + free(expr); format_free_bv_list(values); return 0; } } } else { + if (values != NULL) { + format_free_bv_list(values); + } /* There's a suitable single value available. */ if (alternate_value != NULL) { /* Supply the alternate value. */ @@ -2186,6 +2191,8 @@ format_get_data_set(struct plugin_state *state, Slapi_Entry *e, ret = NULL; *data_lengths = NULL; } + format_free_choices(choices); + free(template); return ret; } -- cgit