diff options
author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-07-07 19:31:23 -0400 |
---|---|---|
committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2008-07-07 19:31:23 -0400 |
commit | d0bc782706b46fad9a293f25ebfbbd9b32503aac (patch) | |
tree | c0ef447b3096075d13376035bd45b312a17eef6d | |
parent | 35ac5aea3b9d4199ff1aa357622154582bd74313 (diff) | |
download | slapi-nis-d0bc782706b46fad9a293f25ebfbbd9b32503aac.tar.gz slapi-nis-d0bc782706b46fad9a293f25ebfbbd9b32503aac.tar.xz slapi-nis-d0bc782706b46fad9a293f25ebfbbd9b32503aac.zip |
- 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
-rw-r--r-- | src/format.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |